PDA

View Full Version : ListStore.update(Model) not update Grid



normanmaurer
27 Oct 2008, 6:18 AM
Hi all,

I have a little problem. I have a Grid which used a BasicPagingLoader and a ListStore. Now I have an Model which was updated and I want to notify the Grid aabout that ( so it refresh).

I thought the ListStore.update(Model) method whould be the right but it not changed anything in the Grid. If I "ckilck" the refresh button it get updated.

Any clue ?

Im Using GXT 1.1.1 and GWT 1.5.2

gslender
27 Oct 2008, 12:59 PM
hard to say without seeing all your code - perhaps distill it into a simple example.

the update needs to change the actual model in the store, and not a copy of it (ie you can't instanciate a model, modify it and then expect it to be updated by calling update... you need to get/find the model out of the store, getRecord and update the record that way (which in turns updates models etc)...

Alex.Leshkin
27 Oct 2008, 10:54 PM
Try to use Store.setMonitorChanges(boolean) (http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/store/Store.html#setMonitorChanges%28boolean%29) instead of direct update call.
But this method should be called before filling store and model should implements ChangeEventSource (http://extjs.com/deploy/gxtdocs/com/extjs/gxt/ui/client/data/ChangeEventSource.html).