PDA

View Full Version : Property of Ext.grid.column.Column (gridColumn) to store extra text information



webfriend13
27 Sep 2012, 11:47 PM
Hi All,

Please tell me if there is a config option or a get/set method of Ext.grid.column.Column (gridColumn) which will allow me to store some additonal text information about column. The idea is once user clicks any column of the grid, i should have access to this information.

Thanks in advance :)

vietits
28 Sep 2012, 12:10 AM
You can use any custom properties for columns provided that they are not the same as existing column properties. Example:


Ext.onReady(function(){
var grid = Ext.create('Ext.grid.Panel', {
renderTo: Ext.getBody(),
width: 400,
height: 300,
columns: {
listeners: {
headerclick: function(ct, column){
console.log(column.cProp)
}
},
items: [{
text: 'Column 1',
flex: 1,
cProp: 'Custom Property 1'
},{
text: 'Column 2',
flex: 1,
cProp: 'Custom Property 2'
}]
}
});
});

webfriend13
28 Sep 2012, 1:28 AM
Hi Vietits,

thank you for quick reply. I realized it after posting the question. 8-|