No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Data Table Multiple Column Sort

    Framework
    custom datatable sort
    4
    4
    1859
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      johnorford last edited by

      I would like to implement multiple column sort for the data table with the least hackery possible.

      Basically if I click sort on two columns, the first columns sort will remain and the second will then be sorted.

      Kind of like a ‘sticky’ sort.

      Any tips?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • G
        genyded last edited by

        Use a data table with multi col sort already in it. The one in Quasar in very limited as are most in any component framework and why entire companies (many with open sorce versions) specialize it data tables only. Advanced features like that are typically only available in those.

        1 Reply Last reply Reply Quote 0
        • nothingismagick
          nothingismagick last edited by

          As @genyded said, that is ULTRA complex and undertaking this in vue will probably make you want to go on vacation. Just thinking out loud, you will probably need to maintain a “ghost object” of the sorted first column and then using some ES-foo

          Object.keys().sort().forEach(()=>{} where you pop the object’s keys from the first sorting according to the second sorting into a new array and then use that to resort the table. My brain hurts just writing that.

          My feeling is that you would be better off learning how to use graphql and prisma.

          1 Reply Last reply Reply Quote 1
          • M
            mightyschwartz last edited by

            Vuetify currently has this. I’m surprised Quasar doesn’t support it. I had it working on vuetify with an external API hitting the DB and refreshing the table contents. In vuetify, the sort object contains and array of objects consisting of column names and asc or desc. Worked really well.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post