直接点击按钮,获取按钮名称,然后判断,js如下
var a = this.options.form.getWidgetByName("bt").getValue();
alert(a);
if(a == "收起") {
this.options.form.getWidgetByName("bt").setValue("展开");
收起代码;
}
else
{
this.options.form.getWidgetByName("bt").setValue("收起");
展开代码;
https://help.fanruan.com/finereport/doc-view-4447.html JS实现一键展开/收起视图树所有节点
https://help.fanruan.com/finereport/doc-view-2030.html JS实现自定义折叠树节点展开层数