Hi,
I have a ListGrid which is editable where I add new rows by calling grid.startEditingNew. setCanRemoveRecords is set to true, so I can delete records by clicking on the red ball on the right hand side of the grid.
However, the delete does not work for records added using startEditingNew. (Records that are loaded from the database can be deleted, but no the ones added by startEditingNew)
A small test case:
Add a few records by clicking the new button and try to delete them afterwards.
SmartGwt Power 4.1 Build 20140511
Regards
Rolf
I have a ListGrid which is editable where I add new rows by calling grid.startEditingNew. setCanRemoveRecords is set to true, so I can delete records by clicking on the red ball on the right hand side of the grid.
However, the delete does not work for records added using startEditingNew. (Records that are loaded from the database can be deleted, but no the ones added by startEditingNew)
A small test case:
Code:
public class TestGrid implements EntryPoint {
public void onModuleLoad() {
final ListGrid grid = new ListGrid();
ListGridField field1 = new ListGridField("name");
ListGridField field2 = new ListGridField("phone");
grid.setFields(field1, field2);
grid.setWidth100();
grid.setHeight(150);
grid.setCanEdit(true);
grid.setAutoFetchData(false);
grid.setCanRemoveRecords(true);
grid.setAutoSaveEdits(false);
grid.setSaveLocally(false);
grid.setEditEvent(ListGridEditEvent.CLICK);
grid.setListEndEditAction(RowEndEditAction.NEXT);
grid.setConfirmDiscardEdits(false);
Button btn = new Button("New");
btn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
grid.startEditingNew();
}
});
RootPanel.get().add(grid);
RootPanel.get().add(btn);
}SmartGwt Power 4.1 Build 20140511
Regards
Rolf