OWOX / brainy-table

Polymer 1.x table element
https://owox.github.io/brainy-table/
MIT License
34 stars 9 forks source link

Dynamic data and column sort question. #12

Open userquin opened 7 years ago

userquin commented 7 years ago

Is there a way to provide external sorting for dynamic data?

The sequence will be:

  1. user click on th[sort-by]: fire sort column change (bubles: true) (sort icon must not change until 4)
  2. listen to sort change (mediator or dom-host of brainy-table) and fire iron-ajax request for current sort
  3. the iron-ajax result is set to table
  4. sort order updated on th[sort-by] and reflected in its icon
web-padawan commented 7 years ago

Good suggestion. We should then add a cancellable event, so mediator could use preventDefault on it. I'm open for a PR, so feel free to contribute if you have an opportunity.

userquin commented 7 years ago

I have a branch in my account, but I dont finish the sample to test and the demo: just a few changes: https://github.com/userquin/brainy-table/tree/dynamic-sort

just change brainy-th and brainy-table: see comments and see changes