Extjs 4 Grid findcolumn

I was looking for a way in extjs 4 to find column columns dynamically because I wrote a function to display errors in the editor grid. In version 3, I did it over

getColumnModel().findColumnIndex(cellname);

but the column model no longer exists, does anyone have an idea?

Hi

+6
source share
3 answers

I just needed to do this, @VoidMan was close. However, you need to specify a view. For instance:

If your column is configured with itemId as follows:

 { header: 'A Column', dataIndex: 'data', width: 70, itemId: 'myColumnItemId' } 

You can call it like this:

 grid.getView().getHeaderCt().child('#myColumnItemId') 
+7
source

This is one of these lines:

 myGrid.headerCt.child('#column') 

where #column is your columnId element. Please note: use itemId, not id, because now the Component and Component id columns should be unique in all your applications.

Hope this helps.

+1
source

take a look at Ext.grid.header.Container and Ext.view.Table.headerCt

0
source

Source: https://habr.com/ru/post/889954/


All Articles