PDA

View Full Version : ext grid column hide/show not working



sooth
29 Dec 2013, 6:09 PM
I have a grid, on certain cases i am showing only some column in grid, so for this i am using hide/show methods on that cases. This is working fine in mozilla, but not working in internet explorer 8 version. any ideas.
I use hide/show and setVisible methods but nothing working in IE8. I am using ext4.1
see my code

var gridCmp = Ext.getCmp('myGrid'); gridCmp.columns[1].hide();
gridCmp.columns[0].show();

Thanks,
sj

scottmartin
29 Dec 2013, 8:40 PM
This seems to work fine in IE8



Ext.onReady(function () {

Ext.create('Ext.data.Store', {
storeId : 'simpsonsStore',
fields : ['name', 'email', 'change'],
data : {'items' : [
{ 'name' : 'Lisa', 'email' : 'lisa@simpsons.com', 'change' : 100 },
{ 'name' : 'Bart', 'email' : 'bart@simpsons.com', 'change' : -20 },
{ 'name' : 'Homer', 'email' : 'homer@simpsons.com', 'change' : 23 },
{ 'name' : 'Marge', 'email' : 'marge@simpsons.com', 'change' : -11 }
]},
proxy : {
type : 'memory',
reader : {
type : 'json',
root : 'items'
}
}
});


var grid = Ext.create('Ext.grid.Panel', {
title : 'Simpsons',
store : Ext.data.StoreManager.lookup('simpsonsStore'),
selModel : {
selType: 'cellmodel'
},
columns : [
{ header : 'Name', dataIndex : 'name', hidden: true }, // hide name column
{ header : 'Email', dataIndex : 'email', flex : 1 },
{ header : 'Change', dataIndex : 'change' }
],
height : 200,
width : 400,
renderTo : Ext.getBody()

});

grid.columns[1].hide(); // hide email
grid.columns[0].show(); // show name

// name and change should be visible

});


Scott.