-
26 Jan 2010 6:53 AM #1
[CLOSED] Record setDirty method not working
[CLOSED] Record setDirty method not working
Hi.
I am trying to use the setDirty method to mark a cell dirty in the grid, but it is not working.
It should be marked dirty after clicking the Change button.
I am using FF. 3.5.7 on Mac.
This is a test EntryPoint:
PHP Code:public class StartupEntryPoint implements EntryPoint {
private int counter = 0;
public void onModuleLoad() {
Window window = new Window();
window.setSize(400, 400);
window.setLayout(new FitLayout());
ColumnConfig nameConfig = new ColumnConfig("name", "Name", 100);
final ListStore<BaseModel> store = new ListStore<BaseModel>();
final BaseModel model = new BaseModel();
model.set("name", "Test");
store.add(model);
Grid<BaseModel> grid = new Grid<BaseModel>(store, new ColumnModel(Arrays.asList(nameConfig)));
window.add(grid);
Button change = new Button("Change");
change.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
model.set("name", "Test" + counter++);
store.getRecord(model).setDirty(true);
store.update(model);
}
});
window.addButton(change);
window.show();
}
}
-
26 Jan 2010 7:01 AM #2
The hole row is marked as dirty. There gets a cssclass assigned to it. There is just no visual indication.
You cannot use setDirty to mark a single cell as dirty. To do that, you will need to mark a SINGLE entry as dirty. You can do that wirh record.set("x",x);
Marking this as closed.
-
26 Jan 2010 7:57 AM #3
Thanks for the clarification.
Maybe a helper method in the gridView for marking the record as dirty will be helpful.
Regards,
Michel.
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote