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>

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

  • Admin


    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.


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

Log in to reply