Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs 4 Grid findcolumn

Tags:

extjs4

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

like image 829
Mike Marti Avatar asked Jun 07 '11 12:06

Mike Marti


2 Answers

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')
like image 186
egerardus Avatar answered Sep 28 '22 01:09

egerardus


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.

like image 37
VoidMain Avatar answered Sep 28 '22 01:09

VoidMain