ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Tree Grid Open and Close All nodes
Title:
B
I
{code}
?
is it possible to create two buttons that open all nodes and close all nodes?
Save Changes
Cancel
Meccanica Rossi
asked yesterday
Answers
B
I
{code}
?
To add collapse and exapnd all buttons for the grid, you could use javascript like this: <button id="expandAll">Expand All</button> <button id="collapseAll">Collapse All</button> <script> function toggleRows(condition) { $('#TreeGrid1 .awe-ghead.awe-row').each((_, row) => { const isCollapsed = $(row).hasClass('awe-collapsed'); if (condition === 'expand' && isCollapsed || condition === 'collapse' && !isCollapsed) { $(row).find('.awe-ceb').click(); } }); } $(function(){ $('#expandAll').click(() => toggleRows('expand')); $('#collapseAll').click(() => toggleRows('collapse')); }); </script>
Save Changes
Cancel
Omu
answered 11 hours ago
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK