Skip to content
Snippets Groups Projects
Commit 336f4b5f authored by gloas's avatar gloas
Browse files

Correction bug treeSelect.js

parent 390b2894
Branches
Tags
No related merge requests found
......@@ -159,6 +159,8 @@
_createDataTree: function(){
var self = this;
$.each(this.options.datas, function(index, cat) {
cat = self._initDataOptions(cat);
$("<h3><a href='#'>"+cat.label+"</a></h3>").
appendTo(self.itemsTree);
......@@ -172,6 +174,24 @@
},
_initDataOptions: function(categorieOrItem){
var self = this;
if(undefined==categorieOrItem.options)
categorieOrItem.options = [];
$.each(categorieOrItem.categories, function(index,cat){
self._initDataOptions(cat);
});
$.each(categorieOrItem.items, function(index,item){
if(undefined==item.options)
item.options = [];
});
return categorieOrItem;
},
_initAccordion: function(){
this.itemsTree.accordion();
},
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment