开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜