Hi Isomorphic,
I'm still trying to reproduce to create a testcase and found this different behavior depending on the way you exit an rowEditor.
I used this testcase (v10.1p_2017-10-05 Classic Dev Mode, because it needs to be slow), but any ListGrid with editing should do it.

Best regards
Blama
I'm still trying to reproduce to create a testcase and found this different behavior depending on the way you exit an rowEditor.
I used this testcase (v10.1p_2017-10-05 Classic Dev Mode, because it needs to be slow), but any ListGrid with editing should do it.
- Exiting via key-up waits for the request to return.
- Exiting via click outside accepts the change directly.
Code:
package com.smartgwt.sample.client;
import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.Version;
import com.smartgwt.client.core.KeyIdentifier;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.types.GroupStartOpen;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Window;
import com.smartgwt.client.widgets.events.ClickEvent;
import com.smartgwt.client.widgets.events.ClickHandler;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.layout.VLayout;
public class BuiltInDS extends VLayout implements EntryPoint {
private IButton recreateBtn;
public void onModuleLoad() {
KeyIdentifier debugKey = new KeyIdentifier();
debugKey.setCtrlKey(true);
debugKey.setKeyName("D");
Page.registerKey(debugKey, new PageKeyHandler() {
public void execute(String keyName) {
SC.showConsole();
}
});
setWidth100();
setHeight100();
recreateBtn = new IButton("Recreate");
recreateBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
new MyWindow().show();
}
});
addMember(recreateBtn);
new MyWindow().show();
draw();
}
private class MyWindow extends Window {
public MyWindow() {
setWidth("95%");
setHeight("95%");
setMembersMargin(0);
setModalMaskOpacity(70);
setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
setTitle("ListGrid editValues behaves differently depending on RowExit method" + getTitle());
setShowMinimizeButton(false);
setIsModal(true);
setShowModalMask(true);
centerInPage();
ListGrid animalsLG = new AnimalsLG();
addItem(animalsLG);
}
}
private class AnimalsLG extends ListGrid {
public AnimalsLG() {
super(DataSource.get("animals"));
setWidth(1000);
setHeight100();
setCanEdit(true);
setAutoFetchData(false);
setAutoFitExpandField("commonName");
ListGridField lifeSpanLGF = new ListGridField("lifeSpan");
ListGridField commonNameLGF = new ListGridField("commonName");
ListGridField statusLGF = new ListGridField("status");
statusLGF.setCanEdit(true); // Why is this needed?
ListGridField dietLGF = new ListGridField("diet");
setFields(commonNameLGF, lifeSpanLGF, statusLGF, dietLGF);
setShowFilterEditor(true);
setSortField("commonName");
setGroupByField("status", "diet");
setGroupStartOpen(GroupStartOpen.ALL);
fetchData();
}
}
}
Blama
Comment