:: Forum >>

Using scrollIntoView

Hi all,

This looks like a great solution to a problem I'm having but my "layout" doesn't return anything for:

<code>
var data = this.getTemplate("layout").getContent("data");
var left = this.getTemplate("layout").getContent("left");
var scrollbars = this.getTemplate("layout").getContent("scrollbars");
</code>

That´s to say that the variables data, left, and scrollbars all result undefined.

I'm using AW.UI.Grid and buid it in the following manner:
<code>
var gridObj= new AW.UI.Grid;
var table = new AW.XML.Table;
var dataName = name + "Data";
var xmlNode = document.getElementById(dataName);
var xmlString = xmlNode.innerHTML;
table.setXML(xmlString);

gridObj.setId(name);
gridObj.setColumnCount(columnHeader.length);
gridObj.setRowCount(rowCount);
gridObj.setHeaderText(columnHeader);
gridObj.setCellModel(table);
gridObj.setSelectionMode("single-row");
gridObj.setSelectorVisible(true);
gridObj.refresh();
</code>

Can anybody shed some light? AW Versión is 2.5.1

Thanks in advance.

Bill
Thursday, June 2, 2011
Bill,

the referenced code is from AW 1.0 and is not compatible with AW 2.x
Alex (ActiveWidgets)
Wednesday, June 8, 2011
Hi Alex,

Thanks for the clarification but..

Is there anyway to do this with 2.5.1?

I looked all over your site and couldn't find anything else. It´s really a necessity.

I'd appreciate any help you could provide.

Bill
Bill
Wednesday, June 15, 2011
Hi Alex,

I finally got back to this and saw that you hadn´t replied with an answer (or at all). Anyway, after hacking it for a while, I seem to have found a solution.

function scrollIntoView(selectedRow){
var rowhx = this.getRowHeight();
var x = this.setScrollTop(selectedRow*rowhx);
}


It puts the selection right at the top of the grid.

It's a shame you couldn't get back to me with this trivial answer (would have saved me an hour).

Hope it works under all conditions. Is there a better way?

Bill
Bill
Saturday, July 2, 2011

This topic is archived.


Back to support forum

Forum search