Q-table __index return undefined
-
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>
-
@jarvilito
See https://forum.quasar-framework.org/topic/4723/quasar-v1-4-4-releasedfeat+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)
-
@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
-
Here is an example from my code.
I changedthis.tableData[this.selected[0].__index]
tothis.tableData[this.tableData.indexOf(this.selected[0])]
Maybe this will help you?
-
@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!
-