Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting 'display' vs 'sort' values #345

Open
toomanyjoes opened this issue Nov 8, 2019 · 1 comment
Open

Setting 'display' vs 'sort' values #345

toomanyjoes opened this issue Nov 8, 2019 · 1 comment

Comments

@toomanyjoes
Copy link

toomanyjoes commented Nov 8, 2019

Datatables gives you the ability to map data like so:

{
  '0' => { 'display' => submission.date_and_time, '_' => submission.date_and_time, 'sort' => submission.timestamp },
  '1' => submission.submitter_initials,
  '2' => submission.title
}

This lets the datatable know that the sort column value is different than the value that it should display.

Is there any way to achieve this using this gem?

If I try this same approach and stick to this gems documentation I just see the whole hash as text in my table.

Also thank you for all the great work. I spent a few hours getting my code working but it was quite wonderful once everything was in place.

@klyonrad
Copy link

klyonrad commented Feb 4, 2020

Datatables gives you the ability to map data like so

What exactly are you refering to?

This does not seem reasonable. Is it even possible to have an Ajax powered datatable where the sorting is not done through the backend? And if you want the the complete data loaded in the frontend you don't exactly need the gem...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants