Reputation: 38
I have a ExtJs Grid with two left most columns locked, Now I have listener which cycles through all the columns of a grid and updates the header information.
var grid = this.grid
var columns = grid.columns;
for(var i=0;i<columns.length;i++)
{
//do something with columns[i];
}
This used to work previously but now after locking columns it no longer works as expected.
Upvotes: 1
Views: 483
Reputation: 244
Extjs Locked columns feature changes how the grid is stored in the Extjs Application tree.
Suppose you have a grid of 5 columns and you lock leftmost 2. Then Extjs internally divides your grid into two grids having 2 and 3 columns respectively. Therefore your code should be :
var grid = this.grid.items.items[0];
var columns = grid.columns;
for(var i=0;i<columns.length;i++)
{
//do something with columns[i];
}
var grid = this.grid.items.items[1];
var columns = grid.columns;
for(var i=0;i<columns.length;i++)
{
//do something with columns[i];
}
Upvotes: 1