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 selection not working with [row-key="--index"] after quasar upgrade

    Framework
    2
    4
    469
    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
      jitendra16 last edited by

      I don’t have unique key in my data set, so i used --index property for row-key and i was able to select single/multiple. But after upgrading to v1.4.5 its not working. I want to know that how to select single/multiple records when data rows don’t have unique key.

      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @jitendra16 last edited by metalsadman

        @jitendra16 https://forum.quasar-framework.org/topic/4723/quasar-v1-4-4-released __index was private and has been removed for performance reasons, what you could do is assign a key prop on your data array.

        Ie.

        //script
        const dataWithIdx = origData.map((val,idx) => ({...val, index: idx}))
        ...
           data: dataWithIdx,
        ...
        <template>
        ...
          <q-table ... row-key="index" ...
        ...
        
        J 1 Reply Last reply Reply Quote 0
        • J
          jitendra16 @metalsadman last edited by

          @metalsadman i also did this work around and it worked perfectly. I wanted to know that, is there any quasar way to do it?

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

            @jitendra16 this is one of the ways to do it, see the link and my explanation.

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