PDA

View Full Version : How to add a column to a Grid?



yAdEs
21 Feb 2012, 11:12 PM
I need to add or del(not hide or show) a column to a grid, I find there is a "add" method to do that, but I can't use the method in a right way, who can help me or give me an example?

mitchellsimoens
22 Feb 2012, 5:52 AM
You can use the reconfigure method on the grid. You can pass null for the store parameter.

yAdEs
22 Feb 2012, 5:47 PM
Thanks?It works!

Romick
23 Feb 2012, 12:58 AM
@yAdEs (http://www.sencha.com/forum/member.php?342983-yAdEs)

Can you please post some examples (peace of working code)?

mashiki
29 Feb 2012, 11:52 PM
I made a Example:

http://jsfiddle.net/mashiki/7Kf3a/4/

FireFox fine

Safari can add column, but date output is not fine.
Someone should correct this. please.

mitchellsimoens
1 Mar 2012, 4:47 AM
You are trying to do this:


new Date('2012-01-08')

in your line:


new Date(rec.get('date'))

Where you cannot rely upon cross-browser parsing like that. Much better way is to do:


Ext.Date.parse(rec.get('date'), 'Y-m-d')

And that should allow you to have the cross-browser parsing.

mashiki
1 Mar 2012, 1:35 PM
Thanks.

I rewrite my example, and now all fine.

http://jsfiddle.net/mashiki/7Kf3a/11/