Extjs 4 Grid findcolumn
I search a way in extjs 4 to find grid columns dynamic, because i wrote a function to show errors in editor grid. In version 3 i've made it over
getColumnModel().findColumnIndex(cellname);
but column model no longer exists, does anybody has an idea?
Regards
I just had to work this out, @VoidMan was close. Need to specify the view though. For example:
If your column is configured with an itemId like this:
{
header: 'A Column',
dataIndex: 'data',
width: 70,
itemId: 'myColumnItemId'
}
You can call it like this:
grid.getView().getHeaderCt().child('#myColumnItemId')
This is something among these lines:
myGrid.headerCt.child('#column')
where #column its your column itemId. Note, use itemId and not id because columns are now Component and Component id must be unique across all your application.
Hope that helps.
take a look at Ext.grid.header.Container and Ext.view.Table.headerCt
精彩评论