quizzl
5 Jan 2012, 2:41 AM
Hello,
I ran into a problem today after removing a proxy from my page. That proxy handled json mapping but because of new requirements that could result in the json having attributes that were nested but could now be null I got rid of the store and manually loop it to create model objects with a null check.
I have a grouped grid that uses the store and has a set of buttons in an action column.
To get the record that an action was performed on I could previously say
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
But now that I manually add the records to the store after looping the JSON I get mismatches. The rowIndex does not match the Index of the correct record in the store.
Any hints of what I must consider?
As a dirty fix I figured that I could use
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getView().getNode(rowIndex).children[0].textContent;
Not happy with this because it could create problems once the data is not in element 0 anymore due to other changes.
I ran into a problem today after removing a proxy from my page. That proxy handled json mapping but because of new requirements that could result in the json having attributes that were nested but could now be null I got rid of the store and manually loop it to create model objects with a null check.
I have a grouped grid that uses the store and has a set of buttons in an action column.
To get the record that an action was performed on I could previously say
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
But now that I manually add the records to the store after looping the JSON I get mismatches. The rowIndex does not match the Index of the correct record in the store.
Any hints of what I must consider?
As a dirty fix I figured that I could use
handler: function (grid, rowIndex, colIndex) {
var rec = grid.getView().getNode(rowIndex).children[0].textContent;
Not happy with this because it could create problems once the data is not in element 0 anymore due to other changes.