| Page 1 of 1 | [ 7 posts ] |
Alberto SantiniYUI Contributor
|
|
|
with addRow you can only append rows being in the same format as others before.
Use the yui dom module to append a row with you need specific things like columns going other multiple cells (colspan = x). But this data gets not written to the RecordSet then! Regards - Kai |
|
subscribe to iniEvent and use getFirstTrEl to get first row.
use a do ... while loop to loop over all current rows: var row = mytab.getFirstTrEl(), newRow; do { newRow = document.createElement('tr'); newRow.innerHTML = "<td>..</td>"; YAHOO.util.Dom.insertAfter(newRow,row); } while ( (row = mytab.getNextTrEl(row))!==null); -or- var recs = mytab.getRecordSet().getRecords(), i=1, a; for(a=0;a<recs.length;a++){ mytab.addRow({},i); i+=2; } in my eyes senseless appraochs, but this should do what you want. By implementing something like this you will run into issues if you want use column sorting. As I already told you, take always a look into api documentation. There you could see that addRow doesnt only append to the table - it also allows you to add a row at given position. start reading! Kai |
|
well vovan, why dont you take a look at datatable examples? or also using google to search for "yui2 datatable initevent" would help...
reportDataTable.subscribe("initEvent", myCallback); regards - Kai |
| Page 1 of 1 | [ 7 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