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

    Qasar 1.9 table selected rows array not updating when state updates

    Framework
    2
    4
    146
    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.
    • A
      awipf last edited by awipf

      The table rows and data update just fine but the selected rows array doesn’t. Anyone run into this or am i doing something wrong. I realize I have no code to show but was wondering if I could get some quicks thoughts first…

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        Don’t use selected rows data to get your data. Use just the keys and do whatever it is you want to do on those rows according to the keys.

        Hope that makes sense.

        Scott

        1 Reply Last reply Reply Quote 0
        • A
          awipf last edited by

          Yeah that makes sense. Thanks.

          1 Reply Last reply Reply Quote 0
          • A
            awipf last edited by

            fyi if it helps anyone. So going off what s.molinari was saying, this is an easy fix. I’m grabbing the items from the state in my table component’s child component and filtering by id of selected.

            computed:{
              ...mapGetters('foobar',['getFoobars']),
            
              updatedSelected(){
                const ids = this.selected.map(a => a.id);
                return this.getFoobars.filter(a => ids.includes(a.id) )
              }
            }
            
            1 Reply Last reply Reply Quote 1
            • First post
              Last post