I want a ListGrid with checkboxes to select records, and editable so the user can edit in-place. Full sample below, but this is the basic configuration:
When I have a record on the ListGrid that is NOT checked, and I double-click on it to edit it, the ListGrid automatically checks it.
See attached screenshot.
Is this a bug?
Is there any way to avoid this?
Any smart workaround other than trying to reset the checkbox state after the edit is complete?
GWT 2.3.0
SmartGWT3.0
Chrome 17
Firefox 6.0.2
Full sample:
Code:
listGrid.setSelectionType (SelectionStyle.SIMPLE); listGrid.setCanEdit (true);
See attached screenshot.
Is this a bug?
Is there any way to avoid this?
Any smart workaround other than trying to reset the checkbox state after the edit is complete?
GWT 2.3.0
SmartGWT3.0
Chrome 17
Firefox 6.0.2
Full sample:
Code:
import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.types.SelectionStyle; import com.smartgwt.client.types.SelectionAppearance; import com.google.gwt.core.client.EntryPoint; public class TestListGridMultiSelectionWithEdit implements EntryPoint { /** * The EntryPoint interface */ public void onModuleLoad () { // create fields final ListGridField nameField = new ListGridField ("name", "Name", 150); final ListGridField emailAddressField = new ListGridField ("emailAddress", "Email Address", 250); // create ListGrid // use SIMPLE selection: // select one or more items as a toggle so you don't need to hold down control keys to select more than one object final ListGrid listGrid = new ListGrid (); listGrid.setTitle ("Validation"); listGrid.setWidth (600); listGrid.setHeight (300); listGrid.setShowAllRecords (false); listGrid.setCanSort (true); listGrid.setCanGroupBy (true); listGrid.setSelectionType (SelectionStyle.SIMPLE); listGrid.setSelectionAppearance (SelectionAppearance.CHECKBOX); listGrid.setShowRowNumbers (true); listGrid.setCanEdit (true); listGrid.setFields (nameField, emailAddressField); // add some data { final ListGridRecord record = new ListGridRecord (); record.setAttribute ("name", "A A"); record.setAttribute ("emailAddress", "a@a.com"); listGrid.addData (record); } { final ListGridRecord record = new ListGridRecord (); record.setAttribute ("name", "B B"); record.setAttribute ("emailAddress", "b@b.com"); listGrid.addData (record); } { final ListGridRecord record = new ListGridRecord (); record.setAttribute ("name", "C C"); record.setAttribute ("emailAddress", "c@c.com"); listGrid.addData (record); } // layout listGrid.show (); } }
Comment