Selecting Items in Quasar Data Tables Externally

  • I have a data table that has checkboxes as a selection mechanism. There is a button outside the datatable which will automatically select an item from the table. When I push this button with no prior selection it works fine but when pushing this button after another selection has been made I get the following error:

    [Vue warn]: Duplicate keys detected: ‘1031’. This may cause an update error.

    found in

    —> <QTable>
    <DEVICES> at src\components\devices.vue
    <LayoutDefault> at src\layouts\default.vue

    The code I have is shown below:

      @click= selectPrime()>
    <q-card flat>
        :filter = "filter"

    The table columns are defined like so:

      devices_cols_sample: [
          label: 'GUID',
          name: 'deviceGuid',
          width: '200px',
          field: 'guid',
          type: 'string',
          filter: true

    And the data is:

      devices_sample: [
          guid: 'SP-779',
          id: 1013
          guid: 'SP-780',
          id: 1031

    The method I am using to select an item from the table (external to the table) is the following:

      this.selected[0].id = 1031

    Is there a better way of selecting a checkbox from a DataTable outside of the DataTable? Is this perhaps a bug in Quasar?
    Shouldn’t any changes to the selected variable happen simultaneously inside the dataTable. It seems that the new value is being checked but the old value isn’t clearing. If this is a bug, is there workaround?

Log in to reply