Hi, two part (related) question:
(1) I’m trying to figure out how to preserve sort.
That is, given a datable with a number of rows, that have been sorted, if I reload that datatable with new data (table.parse(data)), then I seem to lose the sort order.
I was expecting that there would be some way to preserve sort order, even if the data changes. If not, Is there some way to capture the current sort order and then reapply it after the data changes?
(2) Updating a table, preserving current order of first column.
Given a datable consisting of 3 columns: stock, price, quantity, in which the stock names always stay the same, but the price and quantity columns change, all at the same time.
I’d like to be able to sort the table by any of those columns, and then update the information for the 2nd and 3rd columns, while preserving their row order, based on the order of the first column.
In other words, the cells in columns 2 and 3 change their contents, and the sort marker is removed from the header (because it might not make any sense with the new data), but the order of the rows stays the same, based on the current order of the rows in the first column.
table.parse(data) seems to blow away the previous table, and also the current sort.
I could potentially go through each row, copy the data across cell, by cell, but my table is huge (many rows and columns), and updates very frequently.
thanks
David