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

    Sort DataTable programmatically?

    Help
    1
    2
    816
    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.
    • ssuess
      ssuess last edited by

      In the DataTable component, does anyone know of a way to trigger a column sort programmatically, (as if the user had clicked on a particular column header?)

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

        Instead of bothering to trigger a sort, I am just rearranging the array upon which the table is based, works just as well for my needs. In case this helps someone else:

        methods: {
            sortedArray (items) {
              return this.items.sort((a, b) => b.date - a.date)
            },
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post