backbone.datagrid
backbone.datagrid copied to clipboard
render the table after sorting
The table was not updated after collection sorting.
Maybe datagrid view should render after any of the collection events, but I bind only to 'sort' to go one test each time :-)
I'm not sure that the datagrid should listen to the sort event because if you bypass the datagrid to directly call sort on the collection, the rows sort order will be inconsistent with the sort icons displayed in the header.
What do you think?
OK, I'll try fixing also the header :-)
I think updating the table when the collection is externally sorted is insteresting, as allows easier integration with other views manipulating the data in the collection.
Ok, let me know how it goes :+1:
I didn't find a solution to the header, so at least I fixed the bug. I only checked with inMemory collection, but I suppose the other way worked already fine, as remote sorting resets the collection.