【问题标题】:Collapse all nodes initially Infragistics IgTree最初折叠所有节点 Infragistics IgTree
【发布时间】:2016-02-15 06:43:18
【问题描述】:

我正在使用以下 Infragistics 组件来查看分层数据。 http://www.igniteui.com/tree/drag-and-drop-single-tree

我已经初始化了如下所示的树视图,以查看最初展开的树的所有节点。如果我缺少显示所有最初折叠的节点的选项,有人可以建议我吗?

 $("#tree").igTree({
                    checkboxMode: "off",
                    singleBranchExpand: true,
                    nodeClick: function (evt, ui) {

                        if (ui.node.data.Folder == "") {
                            var agreements = [];
                            var entry = [];

                            entry.push(ui.node.data.AgreementNbr);
                            entry.push(ui.node.data.ExternalDescription);
                            entry.push(ui.node.data.Description);
                            entry.push(ui.node.data.EffDate);
                            entry.push(ui.node.data.ExpDate);
                            entry.push(ui.node.data.ReleaseStatus);

                            agreements.push(entry);    

                            $('#example').DataTable({
                                responsive: true,
                                columns: [
                                { title: "Agreement Number" },
                                { title: "External Description" },
                                { title: "Description" },
                                { title: "Effective Date." },
                                { title: "Expiry Date" },
                                { title: "Release Status" }
                                ],
                                data: agreements,
                                destroy: true,
                                processing: true,
                            });
                        }
                        else {

                            var output = ui.node.data.Folder.map(function (obj) {

                                var a = [obj.AgreementNbr, obj.ExternalDescription, obj.Description, obj.EffDate, obj.ExpDate, obj.ReleaseStatus];
                                return Object.keys(a).map(function (key) {
                                    return a[key];

                                });
                            });

                            console.log(output);

                            $('#example').DataTable({
                                responsive: true,
                                columns: [
                                { title: "Agreement Number" },
                                { title: "External Description"},
                                { title: "Description"},
                                { title: "Effective Date"},
                                { title: "Expiry Date"},
                                { title: "Release Status"}
                                ],
                                data : output,
                                destroy: true
                            });
                        } 
                    },
                    dataSource: files,
                    dataSourceType: "json",
                    initialExpandDepth: 0,
                    pathSeparator: ".",
                    bindings: {
                        textKey: "Text",
                        valueKey: "Value",
                        imageUrlKey: "ImageUrl",
                        childDataProperty: "Folder",
                        Description: "Description"
                    },
                    // Enable Drag-and-drop feature
                    dragAndDrop: false
                });

【问题讨论】:

    标签: javascript jquery infragistics ignite-ui igtree


    【解决方案1】:

    使用initialExpandDepth 选项

    initialExpandDepth : -1
    

    您已将该选项设置为0
    如果将initialExpandDepth 设置为-1,则所有节点最初都应显示为折叠状态。

    您可以查看infragistics.com了解更多信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-03-12
      • 2013-06-12
      • 1970-01-01
      • 2014-07-03
      • 1970-01-01
      • 1970-01-01
      • 2014-08-03
      相关资源
      最近更新 更多