Closed GDesclaux closed 6 years ago
Hi,
How to retrieve direct node object reference to the changed nodes only ?
With that :
//initial state $old = []; $("#treeview").hummingbird("getChecked", {attr:"id", list:old, onlyEndNodes:true});
//event $("#treeview").on("CheckUncheckDone", function(){ var current = []; $("#treeview").hummingbird("getChecked", {attr:"data-index", list:current, onlyEndNodes:true}); var listAdd = $(current).not(old).get(); var listRemove = $(old).not(current).get(); if (listAdd.length > 0) { $.each( listAdd, function( key, value ) { ... }); } if (listRemove.length > 0) { $.each( listRemove, function( key, value ) { ... }); } old = current; });
Is there a better way to do that ? Methods to access directly the nodes changed ?
Thanks
Hi,
How to retrieve direct node object reference to the changed nodes only ?
With that :
//initial state $old = []; $("#treeview").hummingbird("getChecked", {attr:"id", list:old, onlyEndNodes:true});
//event $("#treeview").on("CheckUncheckDone", function(){ var current = []; $("#treeview").hummingbird("getChecked", {attr:"data-index", list:current, onlyEndNodes:true}); var listAdd = $(current).not(old).get(); var listRemove = $(old).not(current).get(); if (listAdd.length > 0) { $.each( listAdd, function( key, value ) { ... }); } if (listRemove.length > 0) { $.each( listRemove, function( key, value ) { ... }); } old = current; });
Is there a better way to do that ? Methods to access directly the nodes changed ?
Thanks