Is there a faster way to append to tableView than using appendRow or insertRowBefore/After?
I'm doing pagination, when I have a bunch of rows I have to add to the tableView, I use appendRow and/or insertRowAfter. However, they're pretty slow and freezes the UI for a bit.
Is there a better/faster way to append or insertRows into a tableView?
Contact.findAll({ limit: consts.PER_PAGE, offset: rowsDisplayed - 1, raw: true }, function(rows) {
var numrows = rows.length;
for (var i = 0; i < numrows; i++) {
var row = rows[numrows - 1 - i];
contactTableView.insertRowAfter(rowsDisplayed - 2, row);
}
});
1 Answer
-
If you have a ton of rows to add at once, I believe the recommendation is to update your original data object with them, then take the table object and call
myTable.setData(data);
This will update the table all at once rather than row by row.