PDA

View Full Version : [CLOSED] Get ColumnName from ColumnModel using javascript



speedstepmem4
Dec 17, 2013, 5:22 AM
var columnname = ColumnModel1.getColumnId(value.column);

In 1.x above code working fine.
Guide me to get the same in 2.x.

blueworld
Dec 17, 2013, 10:04 AM
Have a look here:
http://www.sencha.com/forum/showthread.php?234112-How-to-get-grid-click-column-name-on-extjs4




grid.ownerCt.columns[cellIndex].text

Daniil
Dec 17, 2013, 1:28 PM
It might be better to use the getGridColumns method instead of "columns":
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.header.Container-method-getGridColumns

grid.headerCt.getGridColumns()[index]

It looks like the "columns" member is not treated as a property in ExtJS. I.e. it might not contain the up-to-date data.