Closed djlerman closed 8 years ago
What happens when you run your code? Are you getting the wrong height?
On Fri, Aug 8, 2014 at 1:00 PM, djlerman notifications@github.com wrote:
How do I get the height of the document after a collapse or expand?
This is what I thought would work...
$("#example-basic").treetable({ expandable: true, onNodeCollapse: function() { console.log("$(document).height(): " + $(document).height()); console.log("$(window).height(): " + $(window).height()); }, onNodeExpand: function() { console.log("$(document).height(): " + $(document).height()); console.log("$(window).height(): " + $(window).height()); } });
Reply to this email directly or view it on GitHub https://github.com/ludo/jquery-treetable/issues/146.
Your code seems fine (tested locally, in Firefox). $(document).height()
is probably the one you want to look at; $(window).height()
will not change when nodes are toggled.
I did notice however that, combined with drag&drop, you might see some strange values.
This might work as an example. http://fiddle.jshell.net/djlerman/yLb25dy9/show/light/
As you can see in the console.log. The height never changes. I need to get the height of the document when a branch is expanded and then the height of the document when a branch is collapsed.
I have tried this on my own server but I do not have a public directory so I used jsfiddle to show the code.
How do I get the height of the document after a collapse or expand?
This is what I thought would work...