YAHOO.widget.RecordSet
has a bug that causes its addRecords(data,index)
method to insert the records in reverse order when an index is provided. A side effect of this is that DataTable
's addRows(data,index)
will not only insert the data in reverse order, but the added rows will be initially inserted in the wrong place in the tbody (ironically in the correct order). Future render events will cause the inserted rows to move to their correct index, but display in reverse order.
Additionally, and only tangentially related, the magic meta field recordInsertIndex
, which should be usable to identify the index at which to insert records in DataTable
's onDataReturnInsertRows
, isn't used. Instead, what should have been the backward compatible meta field insertIndex
is used.
To get around the recordInsertIndex
issue, simply change the meta key name from "recordInsertIndex" to "insertIndex".
A patch for the addRecords
bug is included in the code below in verbose form. This is the same patch, minified: