react-datatable
react-datatable copied to clipboard
Update event mechanism such that we can play nicely with Flux arch
update datasource event mechanism so we can play nicely with any flux architecture based apps
Take in count that if you are operating an API and use pagination, you'll need to hit the API each time column sort is applied (unless there is only one page). It would be enough if you had a callback for sorting like this:
-
onSort(property, direction)- On API level I would trigger something likeGET <resource>?sortBy=propertyorGET <resource>?sortBy=-property(minus for descending) then and set tabledatato the result either directly or through an action.
In addition I would need a trigger for edit. Something like the following could work:
-
onEdit(row)- Then I would hit an action likeupdateon this callback and that would hit the API withPUT <resource>and update the data model.