I'm using the 06/28 4.1d version of SmartGWT:
SmartClient Version: SNAPSHOT_v9.1d_2013-06-28/PowerEdition Deployment (built 2013-06-28)
And get a javascript exception:
when trying to mark records as removed with:
setCanSelectCells = true, setCanRemoveRecords = true, and setAutoSaveEdits = false.
Here's a testcase to reproduce the issue:
SmartClient Version: SNAPSHOT_v9.1d_2013-06-28/PowerEdition Deployment (built 2013-06-28)
And get a javascript exception:
Code:
10:18:05.606:MUP2:WARN:Log:TypeError: Object [object Object] has no method 'deselect' Stack from error.stack: isc.ListGrid.addProperties.markRecordRemoved() @ smartgwt_test/sc/modules-debug/ISC_Grids.js:24719:24 isc.ListGrid.addMethods.completeRemoveRecordClick() @ smartgwt_test/sc/modules-debug/ISC_Grids.js:49061:18 isc.ListGrid.addMethods.removeRecordClick() @ smartgwt_test/sc/modules-debug/ISC_Grids.js:49029:14 isc.defineClass.addProperties._rowClick() @ smartgwt_test/sc/modules-debug/ISC_Grids.js:16464:23 isc.GridRenderer.addMethods.click() @ smartgwt_test/sc/modules-debug/ISC_Grids.js:14714:17 isc.Canvas.addMethods.handleClick() @ smartgwt_test/sc/modules-debug/ISC_Core.js:55247:33 isc.EventHandler.addClassMethods.bubbleEvent() @ smartgwt_test/sc/modules-debug/ISC_Core.js:30850:40 isc.EventHandler.addClassMethods.handleClick() @ smartgwt_test/sc/modules-debug/ISC_Core.js:28809:24 isc.EventHandler.addClassMethods._handleMouseUp() @ smartgwt_test/sc/modules-debug/ISC_Core.js:28595:54 isc.EventHandler.addClassMethods.handleMouseUp() @ smartgwt_test/sc/modules-debug/ISC_Core.js:28490:26
setCanSelectCells = true, setCanRemoveRecords = true, and setAutoSaveEdits = false.
Here's a testcase to reproduce the issue:
Code:
public class SmartGWT_Test implements EntryPoint { @Override public void onModuleLoad() { VLayout layout = new VLayout(); final ListGrid testGrid = new ListGrid(); testGrid.setDataSource(getClientDataSource()); testGrid.setData(getClientData()); testGrid.setWidth(500); testGrid.setHeight(200); testGrid.setHeaderHeight(60); testGrid.setCanRemoveRecords(true); testGrid.setCanSelectCells(true); testGrid.setAutoSaveEdits(false); layout.setMargin(10); layout.setMembersMargin(5); layout.setMembers(testGrid); layout.draw(); } private ListGridRecord[] getClientData() { ListGridRecord[] data = new ListGridRecord[5]; for (int i = 0; i < 5; i++) { ListGridRecord record = new ListGridRecord(); record.setAttribute("field1", "a1_rand_" + Math.round(Math.random() * 10)); record.setAttribute("field2", "a2_rand_" + Math.round(Math.random() * 10)); record.setAttribute("field3", "a3_rand_" + Math.round(Math.random() * 10)); record.setAttribute("field4", "b2_rand_" + Math.round(Math.random() * 10)); record.setAttribute("field5", "b1_rand_" + Math.round(Math.random() * 10)); record.setAttribute("field6", "c1_rand_" + Math.round(Math.random() * 10)); record.setAttribute("field7", "c1_rand_" + Math.round(Math.random() * 10)); data[i] = record; } return data; } private DataSource getClientDataSource() { DataSource ds = new DataSource(); ArrayList<DataSourceField> dsFields = new ArrayList<DataSourceField>(); for (int i = 1; i <= 7; i++) { dsFields.add(new DataSourceField("field" + i, FieldType.TEXT)); } ds.setFields(dsFields.toArray(new DataSourceField[dsFields.size()])); return ds; } }
Comment