QTable select row when clicking row



  • Currently in order to select a row I must click on the tick box to the left. Is there an easy way to make so that it doesn’t matter where I click in order to select a row?



  • @reath on your <q-tr ... :props="props" @click.native="props.selected = !props.selected">...



  • @metalsadman, that’s a great tip, thanks! I was just looking for that.

    One question though - in this case, when using q-tr with q-td in a body slot, it seems that I will need to effectively rewrite the whole implementation of the body row, e.g.:

    <template v-slot:body="props">
      <q-tr :props="props">
        // 1. the td for the selection column with the q-checkbox and all the logic
        // 2. all other tds for all other columns
      </q-tr>
    </template>
    

    while by default all of this is done by Quasar. So my question is - is there a more efficient way to just make a row clickable, without rewriting the complete default implementation of the body row slot?

    Thank you in advance!


Log in to reply