View Full Version : Programtically writing values to grid

23 Jan 2010, 1:01 PM
I have a popup on my editor grid that lets users set several cells with data. When they enter the data, I grab the Store and add the values but the store.commit doesn't work. It seems that the store even though it has the correct values inside it according to the debugger, never flipped its modified bit because the modified value inside is an empty array. What should I do so that the store will publish the values I wrote?

25 Jan 2010, 6:42 AM
I found a ChangeEvent class that might be related to this but I'm not completely clear on how it works. Do I need to add a ChangeListener and override methods so that when I use
data.set("name", value)

the store will understand that the value has changed without going through the grid and I want it to be persisted?

25 Jan 2010, 8:10 AM
Have you tried to refresh view?


Thanks, Marty

25 Jan 2010, 8:40 AM
No I figured out the problem. I was writing to the model but not to the record so technically it was correct there had been no change.

I was doing
BaseModel MyModel = MyListStore.getAt(0);
MyModel.set("name", value);

What finally worked was:
BaseModel MyModel = MyListStore.getAt(0);
Record r = MyListStore.getRecord(MyModel);
record.set("name", value);

This way the record is updated and the commit happens normally.