i am using Bootstrap-TreeView Plugin and i am getting following error, what i have done is that i have already rendered the tree view, now i wanna have something similar to `"selected=selected"' for all the nodes that i wanna show as checked.
Uncaught TypeError: Cannot read property 'state' of undefined
Following is my code where i am trying to set the nodes by id
var catgories_for_edit = {!! json_encode($product->categories) !!};
$.each(catgories_for_edit,function(index,categoryObject){
$categTreeView.treeview('checkNode', [categoryObject.id, { silent: true } ]);
});
Json data:
// var catgories_for_edit returns following data
[{"id":21,"parent_id":null,"lft":17,"rgt":24,"depth":2,"name":"admin","created_at":"2016-12-29 21:42:25","updated_at":"2017-01-02 08:30:23"}]
referring to following plugin http://ift.tt/1mz6JOF
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire