Scenario:
In a table cell place a delete button. This delete button when clicked, removes the data of that row from the table data.
Now, when the delete button is clicked, clickRow method is getting called, which in turn calling rowSelectionChange. The setTimeout inside it causing the rest of the code to get executed after the data become empty, thus making the this.current[index].vb_dt_checked invalid.
This happens in every browser. The problem is, between the time rowSelectionChange called first and the code inside setTimeout gets executed the currentData becomes changed / empty. Many rows may have been added or deleted in between.
In my opinion, the rowSelectionChange should get called only when the specific checkbox column is clicked or get executed immediately.
The
setTimeout
in the TablerowSelectionChange
is causing error when the table data become empty https://github.com/FE-Driver/vue-beauty/blob/63edb069219925fff35194ab838271a597a4b8b1/vb/components/data-table/data-table.vue#L692Scenario: In a table cell place a
delete
button. This delete button when clicked, removes the data of that row from the table data. Now, when thedelete
button is clicked,clickRow
method is getting called, which in turn callingrowSelectionChange
. ThesetTimeout
inside it causing the rest of the code to get executed after the data become empty, thus making thethis.current[index].vb_dt_checked
invalid.This happens in every browser. The problem is, between the time
rowSelectionChange
called first and the code insidesetTimeout
gets executed thecurrentData
becomes changed / empty. Many rows may have been added or deleted in between.In my opinion, the
rowSelectionChange
should get called only when the specific checkbox column is clicked or get executed immediately.