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

    q-table sorting order using mutated vowels

    Help
    3
    6
    443
    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.
    • SB
      SB last edited by

      Is there a way to set proper lexical order in q-table for UTF-8 strings with mutated vowels using props or do I need to set an explicit method for sorting? If so, is a reviewed solution available?

      dobbel 1 Reply Last reply Reply Quote 1
      • dobbel
        dobbel @SB last edited by

        @SB

        What is the current sorting of UTF-8 in tables with mutated vowels? Could you give an example of what it is now and what you think it should be? Preferably in a codepen.io ( very easy to do , just extend a quasar table example codepen)

        SB 1 Reply Last reply Reply Quote 0
        • SB
          SB @dobbel last edited by

          @dobbel Data is fetched via GraphQL, column name is name. In my case QTable and QSelect using the same data source. For QTable sorting is set by pagination: { sortBy: 'name', descending: false }. Here is the result for QTable:

          Screenshot_2020-11-20 InfoSys.png

          Here is the proper result for QSelect:

          Screenshot_2020-11-20 InfoSys(1).png

          dobbel beets 2 Replies Last reply Reply Quote 0
          • dobbel
            dobbel @SB last edited by

            @SB

            If you think there’s something wrong with the ordering Quasar does you should post a github Issue to bring this to the attention of the Quasar staff. Wrong does not mean wrong for your use case but generally wrong.

            If not than indeed, there is nothing else you can do than create your own sort function.

            1 Reply Last reply Reply Quote 0
            • beets
              beets @SB last edited by

              @SB I would try to use LocaleCompare. In columns:

               {
                  name: 'name',
                  label: 'Name',
                  field: 'name',
               
                  sortable: true,
                  sort: (a, b) => a.localeCompare(b, 'de'),
                },
              
              SB 1 Reply Last reply Reply Quote 1
              • SB
                SB @beets last edited by

                @dobbel, @beets Thank you for your replies. In my case

                sort: (a, b) => a.localeCompare(b, 'de')
                

                is the solution.

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