:: Forum >>

Grid hack for Auto Height


This grid resizes itself for rows fewer than 10. There will not be any scrollbar or empty space for rows fewer than 10.

obj.setSize(640, 205);
obj.setRowCount = function(count) {
    var show = (count > 10) ? 10 : count;
    this.setSize(640, 25 + 18 * show);
    AW.UI.Grid.prototype.setRowCount.call(this, count);
};


Above code works perfect for XP theme. You may want to experiment for other themes.

FYI: Formula for normal XP theme grid.

Height = 20 (header) + 18 * (row count) + 5 (bottom gap) + 2 (if grid has borders)

Cheers,
Sudhaker Raj
Thursday, December 21, 2006

This topic is archived.


Back to support forum

Forum search