Bootstrap-table: After deleting the selected row, the deleted row can be found when querying the selected row

Created on 30 Aug 2020  Â·  9Comments  Â·  Source: wenzhixin/bootstrap-table

Check the source code and find that the operation is this.options.data When getselections, the query is this.data Is this a bug or does it need special treatment?

Bug has PR needs example

Most helpful comment

I think this is a bug since we use this.options.data to keep the original data safe and we use this.data to apply the corresponding filters/sorting etc.. So I think we need to kind of syncronize the addition, update and deletion of rows in these two arrays.

@wenzhixin @UtechtDustin what do you think? In the meantime marked as bug

All 9 comments

I think this is a bug since we use this.options.data to keep the original data safe and we use this.data to apply the corresponding filters/sorting etc.. So I think we need to kind of syncronize the addition, update and deletion of rows in these two arrays.

@wenzhixin @UtechtDustin what do you think? In the meantime marked as bug

Yes, its a bug.

Yes, its a bug.

Thank you for your reply.Mainly insert rows and delete rows

I think this is a bug since we use this.options.data to keep the original data safe and we use this.data to apply the corresponding filters/sorting etc.. So I think we need to kind of syncronize the addition, update and deletion of rows in these two arrays.

@wenzhixin @UtechtDustin what do you think? In the meantime marked as bug

Thank you for your reply.

@RichMoster could you provide us an example ?
I can't reproduce it with mine example.
I checked some rows, use the getSelections buttons and see the selected rows.
After that i clicked on the remove button which removes the rows, if i press the getSelections button again the array is empty.

I met the same scene.
https://live.bootstrap-table.com/example/welcome.html
When I checked Item ID 0, and then click 'delete' button, it works find. But now if I check Item ID 1, and then click 'delete' button, 'Item ID 1' will not be removed. It do nothing, since 'getSelections' store the 'Item ID 0' not 'Item ID 1'.
Please check it.

@RichMoster could you provide us an example ?
I can't reproduce it with mine example.
I checked some rows, use the getSelections buttons and see the selected rows.
After that i clicked on the remove button which removes the rows, if i press the getSelections button again the array is empty.

Sorry, I forgot to provide an example
example:https://live.bootstrap-table.com/code/RichMoster/4625
Step 1: Select data with ID 0 and 1
Step 2: Click the Delete button
Step 3: Click the getSelections button.The result is 0 and 1
Step 4: Select data with ID 2 and 3
Step 5: Click the getSelections button.The result is 0 and 1
Step 6: Click the Delete button.Unable to delete

I met the same scene.
https://live.bootstrap-table.com/example/welcome.html
When I checked Item ID 0, and then click 'delete' button, it works find. But now if I check Item ID 1, and then click 'delete' button, 'Item ID 1' will not be removed. It do nothing, since 'getSelections' store the 'Item ID 0' not 'Item ID 1'.
Please check it.

Yes, the same as my question

Thanks for the example, i could figure out that sidePagination="server" is the problem, which also explains why i cant reproduce the issue.
We will check that!

Minimal example: https://live.bootstrap-table.com/code/UtechtDustin/4645

Was this page helpful?
0 / 5 - 0 ratings

Related issues

typo3ua picture typo3ua  Â·  23Comments

thongkekienthuc12 picture thongkekienthuc12  Â·  16Comments

wenzhixin picture wenzhixin  Â·  35Comments

marccollin picture marccollin  Â·  15Comments

havok2063 picture havok2063  Â·  39Comments