expanding / collapsing all rows in dojo treegrid


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function foldingAll(state, levels) {
  2. // state: boolean, expand all rows if true, collapse all rows if false
  3. // level: integer, how many levels will be affected
  4. for (var i = 0; i < levels; i++) {
  5. var v = grid.views.views[grid.views.views.length - 1];
  6. for (var e in v._expandos) {
  7. for (var a in v._expandos[e]) {
  8. var expando = (v._expandos[e])[a];
  9. if (expando.open != state) {
  10. expando.setOpen(state);
  11. }
  12. }
  13. }
  14. }
  15. }

URL: http://dojo-toolkit.33424.n3.nabble.com/treegrid-help-needed-td904685.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.