PDA

View Full Version : Merge CheckboxSelectionModel and ColumnbModel



PCSpectra
11 Mar 2011, 8:24 AM
I have finally figured out how to create dynamic columns (I think) but when I change the columnbs at runtime I lose the checkbox selection model as the first column as I do not return that from the PHP side.



var cols = Ext.decode(response.responseText);
var temp = [selection];

temp.push(cols);
alert(temp);

grid.reconfigure(grid.getStore(), new Ext.grid.ColumnModel(temp));



The above does not work?!?

Is there Ext helper function or something that can merge my statically assigned SelectionModel with the Columsn returned dynamically?

It's important the selection model come first as well, please and thank you. :)

Cheers,
Alex

PCSpectra
11 Mar 2011, 8:58 AM
This is what I have managed to cobble togather and it appears to work:



var temp = [selection];
Ext.each(cols, function(object, index){
temp.push(object);
});


Is there a more elegant way? Perhaps a single shot Ext method I could call?

Cheers,
Alex