PDA

View Full Version : Remove last row of grid.panel



mingbc
8 Feb 2013, 6:05 PM
After remove the last row of a grid by using

theGrid.store.removeAt(rowIndex);

theGrid.getView().refresh() will get error "Uncaught TypeError: Cannot call method 'removeChild' of null."

Could anybody help out here?

Thanks!!!

mitchellsimoens
11 Feb 2013, 10:03 AM
What Ext JS 4.x.x version are you using? I have never seen this.

mingbc
18 Feb 2013, 11:14 AM
Sorry for my slow response, just back from vacation.

The version I'm using is Ext JS 4.1

mingbc
20 Feb 2013, 5:53 PM
Making some progress...

The following code work ok to insert a row to an empty grid.

//Add an object to grid
...
var r = Ext.create('EM.model.exampleModel');
me.store.insert(0, r);
...
exampleGrid.reconfigure(exampleStore);
exampleGrid.getView().refresh();
...

but clicking on the row would get the following error.

Uncaught TypeError: Object has no method 'getRange' ext-all.js:18
Ext.define.getRange ext-all.js:18
Ext.define.refresh ext-all.js:18
b.implement.callParent ext-all.js:18
Ext.define.refresh ext-all.js:18
b.implement.callParent ext-all.js:18
Ext.define.refresh ext-all.js:18
(anonymous function) ext-all.js:18
(anonymous function) ext-all.js:18

The rows added after the first one don't have the problem.

mingbc
21 Feb 2013, 6:38 PM
With ext-all-debug.js, the call stack like this,

Uncaught TypeError: Object has no method 'getRange' ext-all-debug.js:52064 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)

Ext.define.getRange ext-all-debug.js:52064 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)
Ext.define.refresh ext-all-debug.js:62620 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)
Base.implement.callParent ext-all-debug.js:3732 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)
Ext.define.refresh ext-all-debug.js:105718 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)
Base.implement.callParent ext-all-debug.js:3732 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)
Ext.define.refresh ext-all-debug.js:108050 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)
(anonymous function) ext-all-debug.js:62967 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)
(anonymous function) ext-all-debug.js:1813 (http://localhost:8080/acms-rsw-ui/extjs/ext-all-debug.js)

mingbc
25 Feb 2013, 11:14 AM
It is usage issue which has been caused by mismatch data type and oversight of store synch.