bladesling
19 Jul 2012, 12:48 PM
I would assume it would be fairy easy but I can't seem to get column functions to work. All I want to do is create a button that hides sets of columns on my fairly large table. The problem is, I can't even get one column to hide.
I would prefer to do this by using the dataIndex parameter of the column.
var grid = Ext.create('Ext.grid.Panel', {
store: grid_store,
columnLines: true,
width: 'auto',
title: '<?php echo $title ?>',
renderTo: 'grid',
emptyText: 'No Matching Records',
loadMask: true,
enableLocking: true,
features: [{
ftype: 'summary'
}],
viewConfig: {
stripeRows: true,
getRowClass: function(record, index) {
return record.get('row_class');
}
},
dockedItems: [{
xtype: 'toolbar',
items: [
{
text:'test',
handler : function(){
column = grid.columns[0];
column.hide();
}
}]
}],
columns: <?php echo $grid_columns; ?>
});
I would prefer to do this by using the dataIndex parameter of the column.
var grid = Ext.create('Ext.grid.Panel', {
store: grid_store,
columnLines: true,
width: 'auto',
title: '<?php echo $title ?>',
renderTo: 'grid',
emptyText: 'No Matching Records',
loadMask: true,
enableLocking: true,
features: [{
ftype: 'summary'
}],
viewConfig: {
stripeRows: true,
getRowClass: function(record, index) {
return record.get('row_class');
}
},
dockedItems: [{
xtype: 'toolbar',
items: [
{
text:'test',
handler : function(){
column = grid.columns[0];
column.hide();
}
}]
}],
columns: <?php echo $grid_columns; ?>
});