PDA

View Full Version : How to update items of a ext panel



gauravag2207
16 Jul 2016, 2:50 PM
I have written this code for creating a panel.

function create_panelI(gridI, gridR, gridControl) {
var childPanel = new Ext.Panel({
id : 'childPanel',
autoHeight : true,
width : screen.width + 200,

renderTo : 'childGridUI',
autoScroll : true,
items :[gridI, gridControl, gridR]
});
}


Now the items gridI and gridR are changed. So, how to update the panel.

I tried the below code, but the chrome is crashing and an error is coming
"ext-all.js:7 Uncaught TypeError: Cannot read property 'parentNode' of undefined(…)"


if(Ext.getCmp('childPanel') != undefined)
{
Ext.getCmp('childPanel').removeAll();
Ext.getCmp('childPanel').add(gridI);
Ext.getCmp('childPanel').add(gridR);
Ext.getCmp('childPanel').add(gridcontrol);
Ext.getCmp('childPanel').doLayout();
}


.Please help and let me know what's wrong. It's a bit urgent please.

Gary Schlosberg
18 Jul 2016, 10:21 AM
Can you tell which of these code lines is throwing the error?