Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Datatable - select first record when data has been (re)fetched and t   Message List  
Reply | Forward Message #33891 of 52117 |
Re: Datatable - select first record when data has been (re)fetched and tbl. is drawn


Satyam,

> ...renderEvent upon re-rendering the table except
> for the first time around. The first time initEvent
> gets fired, that's the one you are looking for.

Perfect! yes indeed initEvent is firing every time I populate or
repopulate the dataTable.

Honestly I would have never come to that idea, as I never destroy the
datatable and was associating initEvent with the constructor and not
assuming it would also fire after calling initializeTable() (whitch of
course I also did not have in focus when searching for the "bug").

So in case anyone else needs it, this it what works even on subsequent
repopulating the dataTable:

YAHOO.ddTech....oDataTable.subscribe(
"initEvent",
function() {
var oTable = YAHOO.ddTech...oDataTable;
var nRecords = oTable.getRecordSet().getLength();

if (nRecords > 0){
// Programmatically select first row
// and set focus to the table
oTable.selectRow(oTable.getTrEl(0));
oTable.focus();

}
else {
theOtherControl.focus();

}
}
);


Thanks for pointing me in the right direction.

Regards

Frank






Sun Jul 6, 2008 6:32 pm

dietrich.frank
Offline Offline
Send Email Send Email

Forward
Message #33891 of 52117 |
Expand Messages Author Sort by Date

Hi, I am trying to select the first record of a datatable as soon as the data has arrived. Data is coming in via async-request and the table can be reused for...
dietrich.frank
Offline Send Email
Jul 6, 2008
4:50 pm

dataReturnEvent fires when data has arrived, before it was processed. renderEvent upon re-rendering the table except for the first time around. The first...
Satyam
satyamutsa
Offline Send Email
Jul 6, 2008
4:57 pm

Satyam, ... Thanks, yes, that's why I can't properly use it. ... YAHOO.ddTech.AppointTable.oDataTable.subscribe( "renderEvent", function() { alert("render...
dietrich.frank
Offline Send Email
Jul 6, 2008
5:49 pm

Satyam, ... Perfect! yes indeed initEvent is firing every time I populate or repopulate the dataTable. Honestly I would have never come to that idea, as I...
dietrich.frank
Offline Send Email
Jul 6, 2008
6:32 pm

sorry, small typo. ... should be oEl.selectRow(oEl.getTrEl(0)); minor update: I am meanwhile doing it by employing window.setTimeout() from within the...
dietrich.frank
Offline Send Email
Jul 6, 2008
5:31 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help