如何关闭所有分支机构

时间:2018-05-30 18:50:02

标签: qooxdoo

我尝试关闭qx.ui.treevirtual.TreeVirtual树中的所有分支

 this._tree.addListener( "dblclick", function( e )
 {
     for( var i = 0; i< this._tree.getDataModel().getRowCount(); i++ )
     {
        var child = this._tree.getDataModel().getNode( i );
        if( child.level == 1 && child.bOpened == true )
        {
           this._tree.nodeSetOpened( i, false );
        }
     }
}, this );

然而它说nodeSetOpened不是函数

1 个答案:

答案 0 :(得分:0)

nodeSetOpened是由qx.ui.treevirtual.MNode mixin提供的方法。在应用程序的main()方法的顶部附近,添加此代码以包含mixin`:

// We want to use some of the high-level node operation convenience // methods rather than manually digging into the TreeVirtual helper // classes. Include the mixin that provides them. qx.Class.include(qx.ui.treevirtual.TreeVirtual, qx.ui.treevirtual.MNode);