Expand all grid rows by default with rowexpander - EXTJS 5

时间:2015-10-30 21:49:44

标签: javascript extjs extjs5

I am using the rowexpander plugin in a grid.

To expand and collapse all the rows I use a rowexpander override: https://www.sencha.com/forum/showthread.php?280175-Issue-with-expand-all-when-using-rowexpander-bufferedgrid

However, the grid must have on render all rows expanded.

I tried the solution of the following fiddle, but without success, giving the error:

"Uncaught TypeError: Cannot read property 'hasCls' of null"

Any idea how to solve this?

FIDDLE: https://fiddle.sencha.com/#fiddle/10bg

EDIT: remove comments on lines 99 and 100.

1 个答案:

答案 0 :(得分:1)

您可以尝试使用viewready事件(而不是afterrender):

  

网格视图可用时触发(使用此选项查看默认行)。

工作示例:https://fiddle.sencha.com/#fiddle/10bt