3.0 beta 2

Resizing grid while keeping selected row in view

Hello, I would like to be able to, when a row is selected, resize the grid (make it smaller) and ensure the the row that was selected is still in view. Can anybody tell me how to do these 2 things? Thanks.

Joe
Joe Hudson
April 26,
Joe,

here is the code which adjusts scroll top to make current row visible -

var i = this.getCurrentRow();
var scroll = this.getScrollProperty("top");
var height = this.getRowProperty("height");
var top = (this.getRowPosition(i)-this.getRowOffset()) * height;

if(top < scroll) {
    this.setTimeout(function(){
        this.setScrollTop(top);
    });
}

var max = this.getContentHeight(1);
var bottom = top + height;

if (max + scroll < bottom){
    this.setTimeout(function(){
        this.setScrollTop(bottom - max);
    });
}
Alex (ActiveWidgets)
April 26,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.