| Page 1 of 1 | [ 4 posts ] |
|
I need to get an all selected records of my DataTable. I know that oDataTable's getSelectedRows method returns selected rows as an array of Record IDs. But I need to get an instance Records instead. Which is method should I use for my purposes?
|
|
Have you read DataTable API getRecord ?
Why can't you just loop over the .getSelectedRows array and use .getRecord to return a record and do what you want with it? |
|
I don't want to use a loop I'm looking for an corresponding method.
|
|
There is no such method, and 2.9 is no longer supported .... so,
Code: var recIndices = myDT.getSelectedRows(); var recs = []; for(var i=0; i<recIndices.length; i++) recs.push( myDT.getRecord(recIndices[i]) ); // leaves you with recs an Array of Records .... // if you want a recordset of only the selected ones ... follow up with, var newRS = new YAHOO.widget.RecordSet(); newRS.addRecords(recs); |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group