Reputation: 48
When I use grid.columns
it returns all columns from grid (visible or not), but it's not in current order..
Then I tried grid.getView().getGridColumns()
and it returned the columns in current order, but only the visible ones.
How can I get all columns, visible and not visible, in current order?
Upvotes: 3
Views: 5063
Reputation: 441
I had the opposite problem as I need only the visible ones. For all columns grid.columns seems like the easiest way (since 2.3). I then put them in a map by name because I needed to access row cells:
var headerColumns = myGrid.columns;
var headerMap = {};
//put them in a map of name, index
Ext.each(headerColumns, function(headerColumn, i) {
headerMap[headerColumn.dataIndex] = i;
});
Upvotes: 1
Reputation: 223
you can try
grid.down('headercontainer').getGridColumns();
returns visible and non-visible columns
grid.down('headercontainer').getVisibleGridColumns();
returns only visible columns
Upvotes: 3