3.2.0

adjustScrollHeight

Hi,
I am overriding the adjustScrollHeight method in the grid. I have built a grid that allows rows to be expanded/collapsed when clicked (as described in previous posts). However, scrolling does not work properly. Please see the adjusted code below. I have put debug code at the start of and end of the method. At the end of the method, after I call setScrollHeight(h+3), I make a call to getScrollHeight() and the correct number is returned (i.e. the height with the adjustments made for any expanded grid rows.) However, on entering the method I have a debug line that outputs the scroll height and the height seems to have reverted back to the unadjusted value. Is it possible that the other version of adjustScrollHeight that I am overriding is also being called after it is called in my grid class?

Thanks for any help.
BT

this.adjustScrollHeight = function() {
    var expandHeight = 0;
    var counter = 0;

    for (var row in this.myExpandedRows) {
      expandHeight += EXPAND_HEIGHT;
      counter++;
    }

    var h = ((this.getRowCount() - counter) * this.getRowHeight()) 
                   + expandHeight;
    h += this.getContentHeight(0);
    h += this.getContentHeight(2);
    this.setScrollHeight(h+3);
}
March 22,
Yes, most likely the standard adjustScrollHeight handler runs as well. To cancel it you should return non-zero value from your function.
Alex (ActiveWidgets)
March 22,

This topic is archived.

See also:


Back to support forum