nkezhaya
23 Jan 2012, 10:00 PM
I have a grid that gets displayed from two different buttons (different types of search).
One of the search method requires two additional columns to be displayed in the grid. The latter requires them to be hidden.
This should be a simple, straightforward task (as it was in ExtJS 3.3), but now I have to write this code:
var isReassign = (b.tooltip === 'Reassign Leads');
if(grid.headerCt.gridDataColumns) { // has it been rendered yet?
grid.headerCt.gridDataColumns[3].setVisible(isReassign);
grid.headerCt.gridDataColumns[4].setVisible(isReassign);
} else {
grid.columns[3].hidden = !isReassign;
grid.columns[4].hidden = !isReassign;
}
I've tried using reconfigure() with the correct column configuration, but both of these solutions are extremely slow (we're talking 8-9 seconds on IE).
Is there a way I can show/hide columns using an algorithm similar to the one used in ExtJS 3.3? The show/hide was instantly completed.
(edit) I noticed there's a div (TextMetrics) that very rapidly generates and destroys child notes inside it after I show/hide the columns. Is it slow because the columns are all trying to recalculate whitespace inside all of the cells?
I found this, inside grid/ColumnLayout.js:
len = items.length;for (; i < len; i++) {
items[i].setPadding(headerHeight);
}
:/
One of the search method requires two additional columns to be displayed in the grid. The latter requires them to be hidden.
This should be a simple, straightforward task (as it was in ExtJS 3.3), but now I have to write this code:
var isReassign = (b.tooltip === 'Reassign Leads');
if(grid.headerCt.gridDataColumns) { // has it been rendered yet?
grid.headerCt.gridDataColumns[3].setVisible(isReassign);
grid.headerCt.gridDataColumns[4].setVisible(isReassign);
} else {
grid.columns[3].hidden = !isReassign;
grid.columns[4].hidden = !isReassign;
}
I've tried using reconfigure() with the correct column configuration, but both of these solutions are extremely slow (we're talking 8-9 seconds on IE).
Is there a way I can show/hide columns using an algorithm similar to the one used in ExtJS 3.3? The show/hide was instantly completed.
(edit) I noticed there's a div (TextMetrics) that very rapidly generates and destroys child notes inside it after I show/hide the columns. Is it slow because the columns are all trying to recalculate whitespace inside all of the cells?
I found this, inside grid/ColumnLayout.js:
len = items.length;for (; i < len; i++) {
items[i].setPadding(headerHeight);
}
:/