PDA

View Full Version : [CLOSED] ExtJs How to gridpanel dynamic column add clone component ?



siyahgul
Mar 01, 2015, 6:40 PM
if (findColumnModel.length > 0) {
var c = Ext.clone(findColumnModel[0]); //BooleanColumn clone
com.headerCt.insert(com.columns.length, c); //Uncaught TypeError: undefined is not a function !
} else {
var column = Ext.create('Ext.grid.column.Column', { toolColType: 'dynamic', dataIndex: record[strColNameDataIndex], text: record[strColNameText], flex: 1 });
com.headerCt.insert(com.columns.length, column);
}


error: Uncaught TypeError: undefined is not a function !

siyahgul
Mar 04, 2015, 1:27 PM
if (findColumnModel.length > 0) {
var c = Ext.clone(findColumnModel[0]);
com.headerCt.insert(com.columns.length, c.initialConfig);
} else {
var column = Ext.create('Ext.grid.column.Column', { toolColType: 'dynamic', dataIndex: record[strColNameDataIndex], text: record[strColNameText], flex: 1 });
com.headerCt.insert(com.columns.length, column);
}


ok. i fixed. c.initialConfig

but ComponentColumn does'nt work.

siyahgul
Mar 04, 2015, 1:41 PM
ok it's work. thank you.