How to access the row index in a data table?



  • I went through the documentation looking for an option to access the index of a row in a data table, but could not find any.

    I tried the following with scope="row" and then {{ row.index }}:

    <q-data-table ...>
      <template slot="col-error" scope="row">
        <q-icon name="error" size="2em">
          <q-tooltip>{{ row.index }}</q-tooltip>
        </q-icon>
      </template>
      ...
    </q-data-table>
    

    I also tried {{ row.$index }} with no success.


  • Admin

    Hi,

    When in doubt, why don’t you put just {{ row }} in the QTooltip? You will notice an __index property. That’s what you are looking for.

    -Razvan



  • Right, my bad. I will keep this in mind.


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.