问题
How to expand row in a grid using rowexpander plugin? I am using the following code in my controller
'editbasicinfotitlegrid gridview' : {
afterrender:this.expandAll
}
expandAll: function(){
var titlesGrid = Ext.getCmp('editBasicInfoTitleGrid');
var expander = titlesGrid.getPlugin('myRowExpander');
console.log(titlesGrid.plugins[0]);
expander.toggleRow(0);
}
But this code gives me the following error
Uncaught TypeError: Cannot call method 'down' of null
回答1:
So I have found its solution.The toggleRow() function of RowExpander works only on viewready
Event of grid.So calling this function on viewready
instead of afterrender
worked for me.
来源:https://stackoverflow.com/questions/12340421/how-to-expand-row-in-a-grid-using-rowexpander-plugin-extjs-4-1-1