PDA

View Full Version : Column hide problem



MCSchlemme
6 Feb 2013, 12:38 PM
I'm using EXT 4.0.7.

I have 1 column (ColumnZ) on my grid that is set initially to hide: true.

When I go through the code in debug, the column's config for hide = true.

Now I use the column header menu to check (unhide) ColumnZ.

In debug, ColumnZ's hide config still stays true.

Doesn't a columns config get updated?

Thanks...

slemmon
6 Feb 2013, 4:17 PM
Look for hidden: true - or use column's isHidden() method.

sword-it
7 Feb 2013, 12:28 AM
Hi,

try following code:




Ext.create('Ext.data.Store', {
storeId:'simpsonsStore',
fields:['name', 'email', 'phone'],
data:{'items':[
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
]},
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items'
}
}
});


Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ header: 'Name', dataIndex: 'name' },
{ header: 'Email', dataIndex: 'email', flex: 1 },
{ header: 'Phone', dataIndex: 'phone',hidden:true }
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});

MCSchlemme
7 Feb 2013, 11:47 AM
Got it, thanks.