How to change ORDER BY for a model dynamically via javascript in skuid ?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Experts,

I have a model named "Unread Alerts".
I have added fields to order like shown below:



Which works fine when page loaded.

But, the requirement is, we need to provide a picklist to user :

1. Sort By CreatedDate
2. Sort By Priority
3. Sort By Something Else

Whenever the user pick one of the options above, we need to refresh the table order by the selected field.

How to dynamically change table data by ordering per the field selected ?
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Each field in the table can be set with ordering.




Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb
Thanks Pat, I am aware of it , I should have metioned this earlier in notes .
but here , Business is not willing to keep all the fields but a few.
So the challenge occurred when not having on UI, need to order by table data as and when user select the picklist/filter provided.

Any thoughts ?
(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Raymond's suggestion to see the post is the way to go then. A snippet is the answer.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb
Thanks for the help Raymond and Pat.