【问题标题】:How to close all branches in如何关闭所有分支
【发布时间】:2018-05-30 18:50:02
【问题描述】:

我尝试关闭 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 不是一个函数

【问题讨论】:

    标签: qooxdoo


    【解决方案1】:

    nodeSetOpenedqx.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);

    【讨论】:

    • 非常适合我。谢谢你。我做了一个 this._tree.nodeSetOpened(child, false);
    猜你喜欢
    • 2022-01-19
    • 1970-01-01
    • 2021-01-31
    • 2020-03-13
    • 1970-01-01
    • 2014-01-12
    • 2013-06-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多