I am using the jQuery plugin TreeTable in a similar manner mentioned in blog entry A jQuery tree table for Wicket .
What I want to do now is attaching some JavaScript code in an expand all / collapse all button(s).
The following code doesn't seem to work.
$(".treeTable").treeTable().expand();
And also
$(".treeTable").treeTable();
$(".treeTable").expand();
Very nice challenge.
I've built an 'expand all' feature (because it doesn't have it). Here you have it:
$.fn.expandAll = function() {
$(this).find("tr").removeClass("collapsed").addClass("expanded").each(function(){
$(this).expand();
});
};
To use it, just do:
$(".treeTable").expandAll();
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With