Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/465.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 将所有节点折叠到基础结构树中_Javascript_Jquery_Infragistics_Ignite Ui_Igtree - Fatal编程技术网

Javascript 将所有节点折叠到基础结构树中

Javascript 将所有节点折叠到基础结构树中,javascript,jquery,infragistics,ignite-ui,igtree,Javascript,Jquery,Infragistics,Ignite Ui,Igtree,我使用下面的Infragistics组件查看分层数据 我已经初始化了树视图,如下所示,以查看树的所有节点最初都已展开。如果我缺少任何显示最初折叠的所有节点的选项,是否有人可以建议我 $("#tree").igTree({ checkboxMode: "off", singleBranchExpand: true, nodeClick: function (evt, ui) {

我使用下面的Infragistics组件查看分层数据

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

 $("#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
                });

使用
initialExpandDepth
选项

initialExpandDepth : -1
您将该选项设置为
0

如果将
initialExpandDepth
设置为
-1
,则所有节点都应显示为初始折叠

有关更多信息,请参见