I'm using Ext.ux.grid.RowExpander
var expander = new Ext.ux.grid.RowExpander({
tpl : new Ext.Template(
'<p>{history}</p>'
)
});
it's used in my grid:
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
expander,
...
Now i want all expander rows to be expanded by deafult.
I'm trying to use expander.expandRow(grid.view.getRow(0));
(i think if i make it, i'll be able to use a for loop :) but i get an error
this.mainBody is undefined @ ***/ext/ext-all.js:11
Please, help me to expand all rows of my grid! Thanks!
You can do this with a loop, it's quite simple...
for(i = 0; i <= pageSize; i++) {
expander.expandRow(i);
}
Where pageSize
is the number of records per page in your grid. Alternatively you could use the store's count (probably a more scalable solution)...
for(i = 0; i <= grid.getStore().getCount(); i++) {
expander.expandRow(i);
}