Modified record in Dojo Data Grid - datagrid

How can I get the modified records from a DOJO Data grid. Like in EXTJS we have an attribute named dirty which is set to true if the record is modified similarly do we have any attribute in dojo which says that the record is modified or is there any workaround for the same. Waiting for the reply.

You can use the event onApplyCellEdit of the grid and create an array of changes or something similar. You can get the new value, the row index and the field index.
From the API:
onApplyCellEdit(inValue, inRowIndex, inFieldIndex) Event fired when editing is applied for a given grid cell

Related

Showing all the possible values of a field in App Maker dropdown

I need to create a filter which gets all the possible values for a concrete field, but I'm only getting the values which appears in the current page.
Result
What can I do to get all the values?
It looks like you want to filter table basing on value in the dropdown. In order to do this you need to bind your dropdown's value to datasource's filter:
#datasources.MyData.query.filters.Country._equals
then you need to reload your datasource every time when user changes dropdown's value
// onValueEdit
app.datasources.MyData.load();
You can play with this sample app to learn more: https://developers.google.com/appmaker/samples/project-list/

Kendo Grid: Prevent datasource refreshing on grid filtering

I got a grid displaying +- 4000 candidates. You can search and filter the grid by typing in a textbox. For each character typed there is a 1.5 second debounce before the grid refreshes/filters with the textbox content as a parameter.
On my local database this works like a charm. But on the live environment there is a big performance issue.
Each time the filter is applied, the Read action is called, all data is fetched and filtered. This means a new request to the server for every character typed.
What I want to achieve is that when filtering, the filtering happens on the data inside the grid, instead of refreshing/reloading the whole datasource on every filter.
How can this be achieved?
This can be simply achieved by setting serverFiltering in DataSource to false.
API Reference

Data copied between rows on form's datagrid

Within AX 2009, I have, through compare and compile, added two new controls within a datagrid on a form, a Real edit and a combobox. I have compiled with no issues. The Allow Edit property is set to Yes on both controls.
However, on the form, if I edit one row, whether typing a new number with Real edit or combobox, and don't hit Save but hit the Down Arrow key, the data I typed on the previous records is duplicate in the next record and so on until I release the Down Arrow key, rather than just setting the focus on a new record.
The table where these fields were created doesn't exhibit this behavior. The focus simply moves to the next record and what was typed will not carry over to the next record. Only the form does this...
Has anyone seen this behavior before with AX forms?
You may have omitted to specify the data source on the grid itself?
Or if the new controls are based on Edit methods on the data source, have you got the data source parameter in the method signature?
see http://msdn.microsoft.com/en-us/library/aa637541(AX.10).aspx

Checkboxes and View Based Table View

I am having some difficulty trying to use checkboxes as the selectedIndex in a view based table.
There is good documentation on view based table here:
[View Based Tables ]
However, I after searching and looking on Stackoverflow I can't seem to get my implementation for doing the following.
My view is a table that makes a callout to Yahoo Finance. The table is view based constructed with bindings.
When the table is populated I want to have a check box against each row so that when the user clicks the check box, that row will be updated from Yahoo. Currently this works using multi or single selection using the table view and an observer.. I want to do this with the checkboxes and a button that gets all the checked rows.
The IB setup is as follows:
What is the best way to get the rows where the checkbox is selected? Should I use the array controller or do I need to do something with the table?
Assuming that you use a NSArray of NSDictionaries as your data model, why not add a key/value pair to each "stock" dictionary as a flag? Then in your button action method, just iterate through the data model and trigger an update when the flag is set. Bindings do the rest!

Flex DataGridColumn with array of objects as data provider

I have a datagrid that uses an array of objects as the data provider. The objects are essentially key/value pairs:
{ foo:"something"}
{ bar:"hello"}
{ caca:"lorem"}
The datagrid has 2 columns. The first column is the key and the second column is the value. Right now my grid looks like:
My dataFormatter function makes sure that depending on the column (i.e. the dataField value) the correct key or value gets printed out. This works fine for displaying. However, as soon as I try and edit the value field it essentially adds a new value into the object with a key of '1'. For example, if I edit the {caca:"lorem"} object it will then contain the value {caca:"lorem",1:"new value"}.
Is there any possible way I can set the DataGridColumn so that when I edit a value it will update the value associated with the key rather than inserting a new value? I've tried using a custom item editor but it still does the insert. It seems like I need to be able to update the 'dataField' with the actual key value but I'm not sure how to do that.
Looks like you need to think about where your data is going to be stored. I would recommend listening for a CollectionEvent.COLLECTION_CHANGE event on your data model. That event object will contain info about what change occurred, and you can make any updates you need to make.

Resources