react-datatable icon indicating copy to clipboard operation
react-datatable copied to clipboard

Update event mechanism such that we can play nicely with Flux arch

Open wmira opened this issue 11 years ago • 1 comments

update datasource event mechanism so we can play nicely with any flux architecture based apps

wmira avatar Jan 15 '15 15:01 wmira

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 like GET <resource>?sortBy=property or GET <resource>?sortBy=-property (minus for descending) then and set table data to 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 like update on this callback and that would hit the API with PUT <resource> and update the data model.

bebraw avatar Jan 17 '15 08:01 bebraw