PDA

View Full Version : Manually set Model as edited (dirty)



micgala
19 Jan 2010, 5:25 AM
Hi, is there a method to manually set a model as edited (dirty), making it have the triangle marker?

Tks for helping,
Michel.

Arno.Nyhm
19 Jan 2010, 7:07 AM
the dirty state is stored in a record. and a record has a Record # setDirty(boolean dirty);

so on idea is: you need to get the record from store and set the dirty state of it.

micgala
19 Jan 2010, 7:23 AM
Tks for the reply, but it didn't work... :(

I tried this:



grid.getStore().getRecord(model).setDirty(true);


But it didn't work.

I also tried to call refresh after doing this, but also didn't work.


grid.getView().refresh(false);



Does someone have any idea how to achieve this behaviour?

Arno.Nyhm
19 Jan 2010, 8:52 AM
i have no more idea :-( if i look in the code all things in EditorSupport is also to set the value of activeRecord and this set the dirty flag ... maybe some one else have an idea ...