vicvega / chaltron

Template generator for rails application with bootstrap, devise...
MIT License
9 stars 2 forks source link

Consider using data-order for sorting datatables #8

Closed sektorcap closed 6 years ago

sektorcap commented 6 years ago

See https://www.datatables.net/examples/advanced_init/html5-data-attributes.html

crondaemon commented 6 years ago

Can you provide a use case?

sektorcap commented 6 years ago

No specific use case for the developer who uses chaltron. Just a suggestion to use a different approach for sorting datatables in chaltron. Using data-order you don't need to define the following line https://github.com/vicvega/chaltron/blob/f39998eade4732004568602fbca3c2f48c7c5aaa/app/assets/javascripts/chaltron/datatables.js.coffee#L75

It should be useful if you need different date format in different tables.

vicvega commented 6 years ago

Good catch. I removed any dependency from moment.js.

Each client side table (including datetime fields) can be easily ordered using data-order as you suggested