Hi,
I have a problem with the rowExpander plugin for MODX Grid:
If a row is expanded and the grid is refreshed, the expanded row seems to collapse but the [+] sign stays at [-].
So I tried to collapse all expanded rows before refresh happens.
This is the part where the rowExpander is defined:
// A row expander for newsletter grid rows (additional informations)
this.exp = new Ext.ux.grid.RowExpander({
tpl: new Ext.Template(nlInfos)
,enableCaching: false
});
Here is the code part where I'm calling the collapseAll method:
{
xtype: 'xcheckbox'
,id: 'autorefresh'
,name: 'autorefresh'
,boxLabel: _('goodnews.newsletter_grid_autorefresh')
,description: _('goodnews.newsletter_grid_autorefresh_tooltip')
,hideLabel: true
,ctCls: 'gon-checkbox-toggle'
,inputValue: 1
,listeners: {
'check': function(cbx,checked){
this.collapseAll();
this.toggleAutoRefresh(cbx,checked);
}
,scope:this
}
}
The problem is - if I call the collapseAll method I get the following error in console log:
Uncaught TypeError: this.exp.collapseAll is not a function
at GoodNews.grid.Newsletters.collapseAll (modx.grid.js:512)
at GoodNews.grid.Newsletters.check (newsletters.panel.js:270)
at h.Event.fire (ext-all.js:21)
at S.fireEvent (ext-all.js:21)
at S.setValue (ext-all.js:21)
at S.setValue (utilities.js:509)
at S.onClick (ext-all.js:21)
at HTMLInputElement.I (ext-all.js:21)
I had a look at the code in modx.grid.js
,collapseAll: function() {
if (!this.exp) return false;
this.exp.collapseAll(); <--- this line throws an error!
this.tools['minus'].hide();
this.tools['plus'].show();
return true;
}
Any hint on how to solve this?
Could this be a bug in MODXExt?
Thanks,
Martin