3.0 beta 2

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
July 28,
How about you put obj.setSelectedRows([1]); after document.write(obj);?
flashsnake
July 28,
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
July 29,
sorted ir out!
Another post on the forum describes a bug in v2.0 and a workaround.
So now it is ok.
Adi
July 30,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.