Collapse rows in treeview-table onLoad (HTML) with javascript -
i have treeview-table used collapse , expand data, how can show collapsed rows on load? use collapse-expand:
if (tr.hasclass('collapse')) { tr.removeclass('collapse').addclass('expand'); children.hide(); } else { tr.removeclass('expand').addclass('collapse'); children.show(); } return children;
this jsfiddle: http://jsfiddle.net/vd5bh/79/
just add in end:-
$('.toggle').trigger('click');
based on current logic toggling on clicked span.toggle
current state. in document ready right @ end trigger click event span.trigger
. make of them collapsed.
Comments
Post a Comment