0

I´m using fuelux treeview to display a list , but I want expand all folders or nodes when page load.

I´m using fuelux.tree.min.js.

Below the code for load treeview:

       $('#trvMembers').ace_tree({
           dataSource: treeDataSource,
           loadingHTML: '<div class="tree-loading"><i class="ace-icon fa fa-refresh fa-spin blue"></i></div>',
           'open-icon': 'ace-icon tree-minus',
           'close-icon': 'ace-icon tree-plus',
           'selectable': true,
           'selected-icon': null,
           'unselected-icon': null

       });

The questions is: is there any parameter or function to expand all folders when load page?

1 Answers1

0

You can call $().tree('discloseAll');on a Fuel UX tree and it will open all the visible nodes, but I don't know about Ace Admin trees. See the following documentation.

  • Thank You, but doesn´t work $().tree('discloseAll') for Ace Admin Trees. I accessed the documentation and tried to use tree.js. So I created a file and copied tree.js for my file. But, new error in tree.js file in line 82 . Uncaught TypeError: this.options.dataSource is not a function. – Gabriel Costa Alves Jul 23 '15 at 12:38
  • Yes, the Fuel UX tree requires a `datasource` function to return the items and folders of the folder that is opening. – Interactive Llama Jul 23 '15 at 16:25
  • Yes, I´m using a datasource.... var DataSourceTree = function (options) { this._data = options.data; this._delay = options.delay; } – Gabriel Costa Alves Jul 23 '15 at 19:25
  • But, same error I suspect that the code tree.j is wrong where can I find the current code for tree.js? – Gabriel Costa Alves Jul 23 '15 at 19:35
  • https://github.com/ExactTarget/fuelux/releases Will give you the code. I know that Ace Admin does modify Fuel UX source code, so I can't help only help you with the Fuel UX API. I do know the last time they updated their version of Fuel UX. Here is our documentation http://getfuelux.com/javascript.html#tree – Interactive Llama Jul 24 '15 at 15:57
  • Thank you. Other questions: What files do I reference in my project ? I add Need Some More ? Because, if I add this only, the same error: "Uncaught TypeError: this.options.dataSource is not a function". This error occur in tree.js Tks – Gabriel Costa Alves Jul 24 '15 at 18:03