0

so I've created a hierarchical grid that is populating and auto-expanding all the nodes (I'm using it as a report display. We don't want to allow users to collapse the nodes)

However, removing the "collapse" icon still leaves a little "hotspot" to the left of the parent nodes, where if a user accidentally clicks it, then records will appear to "dissappear.

How can I disable the "collapse" functionality?

http://jsfiddle.net/KevinGabbert/ZB2De/3/

KevinDeus
  • 11,988
  • 20
  • 65
  • 97
  • Reading [the docs](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:subgrid), it looks like the whole point of `SubGrid` is to allow it the ability to collapse. Do you need to use `SubGrid`? If so, you'll have to mod the plugin code, I think. – Owlvark Aug 24 '12 at 22:20
  • been looking around. This might do it.. http://stackoverflow.com/questions/2924501/disable-subgrid-expansion-for-selected-rows-of-jqgrid – KevinDeus Aug 24 '12 at 22:28
  • @Owlvark, I would debate that the whole point that having a subgrid means you always want to show and hide. we are programmers! we always want things our way! :) – KevinDeus Aug 24 '12 at 22:39

1 Answers1

0

got it..

since I am auto-expanding all the nodes when the grid, I can unbind the event immediately after expansion.

Before:

$(".sgcollapsed","#tableToLoad").each(function() {
        $(this).trigger("click");
});

After:

$(".sgcollapsed","#tableToLoad").each(function() {
        $(this).trigger("click").unbind('click');
});

http://jsfiddle.net/KevinGabbert/ZB2De/11/

KevinDeus
  • 11,988
  • 20
  • 65
  • 97