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

    QTable Multi-Select selects one row, but visually selects all rows

    Help
    3
    8
    922
    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.
    • T
      tonyskulk last edited by tonyskulk

      Hello, I have a QTable with multi-select and my key is an id. When I select one checkbox I can see that only the corresponding row is selected in the underlying model (this.selected contains only the selected row´s data).
      But visually all rows have been selected. It seems that the key is not unique, but you can see in the table data, that it is unique (see the ID table column).

      Here is a working example: https://codesandbox.io/s/codesandbox-app-ory6f

      Can someone explain to me what I am doing wrong?

      Thanks,
      Tony

      1 Reply Last reply Reply Quote 0
      • T
        tonyskulk last edited by

        Because nobody replies and that, can I assume that this is a bug?

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

          @tonyskulk it isn’t, you see the example in docs works, you probably didn’t set a unique row-key.

          1 Reply Last reply Reply Quote 0
          • T
            tonyskulk last edited by

            @metalsadman Seems like the problem is the nested key I wanted to use. I had to switch the row-key field to an attribute which exists directly on the row without any nested structure (in my case: row._id.$oid, which is the default dealing with json documents coming from mongodb).
            Or do you know a way to set up a nested key reference. I tried:

            row-key="_id.$oid"
            

            but that is not working.

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

              @tonyskulk since it’s an object you’ll need to supply a function for row-key prop, ie. :row-key="row => row._id.$oid". check the description in the api cards.

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

                @metalsadman per the docs, when I do this :row-key=“row => row.ID” I get this error:

                Invalid prop: type check failed for prop “rowKey”. Expected String with value “function(row) { return row.ID }”, got Function

                Also the docs says " If supplying a function then for best performance, reference it from your scope and do not define it inline", but I haven’t been able to get that working either. Do you have any ideas?

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

                  @bdaviddee check if you are using latest quasar version.

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

                    @metalsadman Yup you’re right, needed an update, Thank you! 👐🏼

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