Grid row updating Bad parenting

I was doing something else, and was using the auto resize plugin, and the grid refresh/resize itself after I set the data WITHOUT CALLING $APPLY() : O . If you replace your grid's data object with another it now uses hashing by default to detect changes and if you haven't provided your own hashing function it just uses row.$$hash Key.

So if row.$$hash Key of the new row matches $$hash Key of an old row, even if the object is different, it won't replace the row or update anything.

I would then clone the grid's data to a new object, modify it, then reassign it to the grid's data object again.

Ng-grid would then inspect the rows and detect that since the $$hash Key (which had been cloned along with the rest of the data) was the same, the row must be the same, irrespective of the values within it.

p=preview If you can paste the data that your server is returning as well as your HTML that would be helpful. Note that I I pasted your code into a plunker and don't see anything wrong with it: Hrm? Could you provide a plunker (perhaps based on the tutorial)?

p=preview If you can paste the data that your server is returning as well as your HTML that would be helpful. Changing the data should just work - it's in one of the tutorials (sorry, away from my computer and can't remember which one). Do you have data and its displaying, then you change it and no update?

There is the possibility to move any row in the grid.

The user should include dhtmlxgrid_file into the page to make moving rows from script possible.

For deleting items you need to include a delete command column.

If the issue is closed that usually means we think it is resolved b) what version are you using - ng-grid or ui-grid?

c) usually the problem is one of pointers and objects - if you assign your data as a) comments on closed issues can easily get missed.

To whom may also came here frustrated: ng Grid won't update if you edit-in-place your data array by overwriting data array members so that the length stays the same.

Ng Grid watches on array pointer and on its length, so just replace array with new one each time you recive data.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “grid row updating”