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 __index return undefined

    Help
    3
    6
    1164
    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.
    • J
      jarvilito last edited by

      Hi i tried to access the index of my table using props.row.__index but when i console log it it return undefined. here is my code

                <q-tr :props="props">
                  <q-td key="action">
                    <q-btn
                      @click="deleteLine(props.row.__index)"
                      round
                      flat
                      color="red"
                      icon="close"
                    />
                  </q-td>
               </q-tr>
      SB 1 Reply Last reply Reply Quote 0
      • SB
        SB @jarvilito last edited by

        @jarvilito
        See https://forum.quasar-framework.org/topic/4723/quasar-v1-4-4-released

        feat+perf(QTable): Skip adding __index to each row (#5608) (might be considered a breaking change if you relied on this undocumented prop; use dataTable.indexOf(rowObject) instead)

        J 1 Reply Last reply Reply Quote 1
        • J
          jarvilito @SB last edited by

          @SB hi thanks for sharing, already look into it, but im not quite sure how to use dataTable.indexOf(rowObject)? Did you happen to know how to use it in my situation? Thanks

          SB 1 Reply Last reply Reply Quote 0
          • SB
            SB @jarvilito last edited by

            @jarvilito

            Here is an example from my code.
            I changed this.tableData[this.selected[0].__index] to this.tableData[this.tableData.indexOf(this.selected[0])]

            Maybe this will help you?

            J 1 Reply Last reply Reply Quote 1
            • J
              jarvilito @SB last edited by

              @SB said in Q-table __index return undefined:

              (this.selected[0])]

              seems like you are doing it in built in selection on q-table, im actually creating a customize button to delete the selected row, but this will help . Thanks mate!

              1 Reply Last reply Reply Quote 0
              • metalsadman
                metalsadman last edited by

                @jarvilito https://forum.quasar-framework.org/topic/4758/q-table-selection-not-working-with-row-key-index-after-quasar-upgrade/2

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