View Full Version : rowexpander expandAll by default

30 Mar 2015, 1:51 AM
I attached an Ext.grid.plugin.RowExpander plugin into Ext.grid.Panel which associated with a datastore, Ext.data.Store.

Is there any way to show the grid panel with all rows are expanded by default? I searched the API of Ext.grid.plugin.RowExpander and found no attributes or method to do it. Also, there is no method to expand a single row and even check whether the current row is expanded!
And the method toggleRow() also does not work. It complained "down" method does not existed at the line:

nextBd = row.down(me.rowBodyTrSelector, true),

Here is my code:

var ltExpander = {
ptype: 'rowexpander',
rowBodyTpl : { ...... }
var panel = Ext.create('Ext.grid.Panel',{
hideHeaders: true,
store: Ext.create('Ext.data.Store',{
fields: { ...... },
listeners : {
datachanged : function(store, eOpts){
var expander = panel.plugins[0];
for (var i = 0; i < panel.getStore().getCount(); i++) {
expander.toggleRow(i, store.getAt(i)); //does not work
columns: {......},
plugins: [ltExpander],
stripeRows: true,
height: 500,
collapseFirst: false, collapsible: false, animCollapse: false}

Gary Schlosberg
1 Apr 2015, 1:47 PM
Here's a thread with a solution I hope will work for you: