Multisort with options of badges

Multisort with options of badges

MausinoMausino Posts: 61Questions: 19Answers: 0
edited April 2021 in General

Hello, in many apps or programs you can use multisort...

Please i want know you opinions :)

It is nice, but if you store your state in session, cache, localStorage, even in Database you must fight with one problem:
If you come back to dataTable for day, or more (sometimes 10min +) you will ask what is the primary column, secondary, third etc...
you lost and you sort again because you want sure that you make good decision based on your datas.

I suggest add new feature badges (or call whatever you want) see the image...

Someone likes it someone not... will great if will possible by api or option to have it -> multisortBadge: true/false and second option like onlyMultisortBadge: true/false (false mean that badge will show also in every sort... true will show only 2+ sorts in table)

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Hi Mausino,

    Thanks for the suggestion but I've got to confess, I don't actually understand what you are looking for here. Do you want a button that will triggering a specific ordering to be applied to the table? If so, you could do that with the order() method to apply the order you want.

    Allan

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Hi Allan.
    Just guessing, but I think the idea is to have a quick visual guide to the current sort settings. E.G. from the above image, column 2 desc within column 1 asc.

  • kthorngrenkthorngren Posts: 21,322Questions: 26Answers: 4,948

    One idea, to expand on Allan's, is to use the order() API to get the column order then display that somewhere. Maybe a div above the table. Could add a custom toolbar or update the th elements in the header. Might be difficult to create the badges as depicted.

    Kevin

  • MausinoMausino Posts: 61Questions: 19Answers: 0

    @Alan @tangerine say it exact... it's for visual guide.. it's only idea which come from daily using of dataTables of me and my employyes :)

    We are thankful also for multisorting as is, but this is idea only about better UX

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    You could certainly use the order() method to get the currently applied ordering as Kevin says, and also use order to know when to update your control. With that it would be quite possible to create an external control that shows the current state of the table's ordering.

    If you want to show that inline with the table headers though (is that your aim here?) then that would probably require a custom header renderer.

    Allan

  • MausinoMausino Posts: 61Questions: 19Answers: 0

    @alan

    i still need to much learn about dataTables and now for me "custom header renderer" it's little bit strong coffee :)

    But when i will more skilled, sure i will post example how make it here :)

    And also if you will have some features list... i think that will nice to think about this order number of orders there.

This discussion has been closed.