Re: [visualization-api] maintaining sort state in a table

2015-09-24 Thread 'Daniel LaLiberte' via Google Visualization API
Thanks for posting your code, and your update. Preserving and restoring the entire row order is certainly simpler and faster than what I was suggesting. But one potential limitation comes up if the data can be changed, including the adding or removing of rows. I thought that was what you wanted

Re: [visualization-api] maintaining sort state in a table

2015-09-24 Thread David Manz
I had meant that there could be modifications to the order that are not the result of sorting, but now that I think about that, they wouldn't be reflected in the sortIndexes unless there were a subsequent sort, so you're right, sortIndexes isn't the definitive source for row ordering. In any

Re: [visualization-api] maintaining sort state in a table

2015-09-23 Thread David Manz
Here's an improved version: http://jsfiddle.net/p96x6pxz/2/ It maintains entire sort state (not just the last sort) and selection state across redraws. David On Fri, Aug 28, 2015 at 9:20 PM, David Manz wrote: > Daniel, > > Thank you for your guidance--it was very

[visualization-api] maintaining sort state in a table

2015-08-28 Thread David Manz
I have a table with multiple sortable columns and dynamic data. When the data in the table is updated, I need to redraw the table, and I would like to maintain the sort state across the redraw. However, it appears to me that there is no way to do this without actually modifying the order of

Re: [visualization-api] maintaining sort state in a table

2015-08-28 Thread 'Daniel LaLiberte' via Google Visualization API
At this point, yes, you'll have to manage the sorting yourself, which would probably be easiest using getSortedRows() and constructing a DataView with those rows using setRows(). The Table chart only knows about one column for sorting so it can indicate that column in the header; it also supports

Re: [visualization-api] maintaining sort state in a table

2015-08-28 Thread David Manz
Daniel, Thank you for your guidance--it was very helpful. I considered your idea of keeping the history of sorts and then replaying them upon a redraw, but that's a bit complicated and it is conceivable that the order of rows could change in response to events other than sorting--the Netflix DVD