The DataTable has no direct way of doing that, actually, it wouldn't be a
bad idea if you filed a Feature Request on SourceForge. In the meantime, I
tried this code:
var dt = YAHOO.example.ClientPagination.myDataTable; // shortcut
var recId = dt.getSelectedRows(); // get the selected rows
recId = recId; // take the first record Id from the above array
var rec = dt.getRecord(recId); // now, take the actual record
console.log(rec.getData()); // just so see if it is the right one
var recIndex = dt.getRecordSet().getRecordIndex(rec); // take the
position of that record in the recordset
var paginator = dt.get('paginator'); // get the paginator object
var rpp = paginator.getRowsPerPage(); // read the rows per page value
paginator.setPage(Math.floor(recIndex / rpp) + 1); // do the math and go
I placed a button on the table and when clicked the above code is run. I
actually tried the code with a local copy of the client-side pagination
, that is where the reference to the DataTable comes from in the first line,
the one I assign to the shortcut 'dt'. I jumped to a random page, selected
a record in it, jumped elsewhere and then clicked the button and the page
with the record selected showed up. It will only go to the first of the
recordset selected, if more than one.
----- Original Message -----
From: "out4colors" <jim.harlow@...>
Sent: Tuesday, March 04, 2008 4:01 PM
> I have YUI 2.5.0 which I am using with Firefox 126.96.36.199. I call
> selectRow() on a datatable row which selects the row OK, but sometimes
> this row is not visible. How can I scroll to that row programmatically?
> Yahoo! Groups Links
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.516 / Virus Database: 269.21.4/1309 - Release Date:
> 03/03/2008 18:50