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 selected array don't update

    Framework
    3
    3
    1000
    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
      amartynov last edited by

      Hi!
      I use quasar q-table with selected rows
      <q-table
      color=“primary”
      :data=“serverData”
      :columns=“columns”
      row-key=“uuid”
      @request=“request”
      :loading=“loading”
      :selected.sync=“selected”
      selection=“multiple”
      :pagination.sync=“serverPagination”
      >
      …
      selected is defined as:
      export default {
      data () {
      return {
      …
      selected: []
      }
      }
      The table is updated every 10 seconds and the data in it can change. If I select some rows and after that the table is updated, then old data will remain in selected.
      Why it happens? After all, sync implies two-way communication
      How to solve this problem?

      thank

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

        If the data of the table changes, should it be assumed that the formerly selected values not be kept “alive”, if those same values are still there? In other words, if they are the same row values, why not leave them selected?

        If you want to “unselect” the rows, just empty the selected array, when you do the update.

        However, that would seem like bad UX to me, because if I am making a decision to select rows and it takes more than 10 seconds, my selections would happen to disappear on me. That would get a WTF? out of me.

        Scott

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

          @s-molinari said in q-table selected array don't update:

          If the data of the table changes, should it be assumed that the formerly selected values not be kept “alive”, if those same values are still there? In other words, if they are the same row values, why not leave them selected?

          If you want to “unselect” the rows, just empty the selected array, when you do the update.

          However, that would seem like bad UX to me, because if I am making a decision to select rows and it takes more than 10 seconds, my selections would happen to disappear on me. That would get a WTF? out of me.

          Scott

          Well said Scott;

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