:: Forum >>

set selected row before page loads

Hi,
I found no way to pre-selcet a certain row in the table when the page loads.
prior to version 2 the following code used to do that:
obj.setSelectionProperty("index","1");

I am using a single-row selection model and obj.setSelectedRows([2]) makes the first row disappear altogether.

My full code which does not work is as follows:


var myData = [["a","b","c",],["a","b","c",],["a","b","c",],];
var myColumns = ["s","s","s",];
var obj = new AW.UI.Grid;
obj.setId("tabulated_data1");
obj.setRowCount(3);
obj.setColumnCount(3);
obj.setCellText(myData);
obj.setHeaderText(myColumns);
obj.setSelectorVisible(true);
obj.setSelectorText(function(i){return this.getRowPosition(i)+1});
obj.setSelectionMode("single-row");
obj.setSelectorWidth(28);
obj.setHeaderHeight(20);
obj.setSelectedRows([1]);

document.write(obj);


Thanks for your help
Adi
Friday, July 28, 2006
How about you put obj.setSelectedRows([1]); after document.write(obj);?
flashsnake
Friday, July 28, 2006
Hi,
Thanks for your advice but it is exactly the same result...
The first row in the table does not come up at all.
Try for yourself and see..

Ideas anyone ? this seems a really simple feature.

Adi
Saturday, July 29, 2006
sorted ir out!
Another post on the forum describes a bug in v2.0 and a workaround.
So now it is ok.
Adi
Sunday, July 30, 2006

This topic is archived.


Back to support forum

Forum search