PDA

View Full Version : How to expand all row with RowExpander automatically. [extjs-4.2.1]



mashiki
5 Jul 2013, 4:39 AM
Hello.

I want to expand all rows of the grid with RowExpander.

I try to use private method toggleRows(), but it is failed.

Please tell me how to expand all row with RowExpander automatically.



// Create main grid
var optionsGrid = Ext.create('Ext.grid.Panel', {
renderTo: idGrid,
store: 'optinfostore',
disableSelection: true,
plugins: [{
ptype: 'rowexpander',
rowBodyTpl: '<div class="dmsInnerGrid"></div>',
expandOnDblClick: false
}],
columns: [{
text: hdrText,
dataIndex: 'show',
flex: 100
}],
listeners:{
viewready: function () {
var me = this,
view = me.view;
(new Ext.util.DelayedTask(function(){
var rowIdx = 0;
// expand all rows
me.getStore().each(function(rec) {
me.toggleRow(rowIdx++, rec);
});
})).delay(200);
}
}

slemmon
8 Jul 2013, 11:29 AM
I'm afraid there isn't a method on the plugin to expandAll / collapseAll.

mashiki
9 Jul 2013, 9:37 AM
I expect the plugin has
-1 config to set specified/all rows expanded when the main grid's first show.
-2 method to expand/collapse specified row
-3 method to expand/collapse all row
but I can't find.

I want first item or equivalent code now, temporary I search all el selected by '.x-grid-row-expander' and fires 'mousedown' event with DelayedTasked function.

And more infomation in the document. :-)
How to treat him is not known well.

dgmelvin
5 Feb 2014, 5:12 PM
I'm wondering if there is a plan to provide this. Seems like a pretty obvious thing that anyone using the plugin will want to use.

maheswari
21 Nov 2017, 10:48 AM
I'm wondering if there is a plan to provide this. Seems like a pretty obvious thing that anyone using the plugin will want to use.

Yes!