[Data Grid Reactive] Data refresh problem of datagrid
Question
Forge component by Bruno Martinho

Hi

When I deleted the data, due to the limitation of this record of data, it could not be deleted, and a warning message was thrown. At this point, the screen does show that the data has been deleted, although it has not been deleted in the database. In this case, how can I ensure that the screen data will not be deleted when it encounters a warning.

I tried refreshing the data source of the datagrid when I encountered a warning, but

it didn't work.

can you help me.

For details, please refer to the order of operations of my pictures

 

Hello @He Caixia,

Thanks for bringing this interesting use case. We are going to try to replicate it, discuss it internally and try to figure out the best way to handle it.

Best regards,
Tiago Pereira 

mvp_badge
MVP

Hello @He Caixia!

If I understood your code and use case correctly, if the user removes a protected row(s), a warning will be displayed and the rows will not be removed.

If my understanding is correct, then a better way to achieve this, would be to make use of the GetSelectedRowsData API that will return you the list of currently selected rows. This way you could validate if the rows were protected and if yes, display the warning, otherwise, remove them using the RemoveSelectedRows API.

The sample Add/Remove Rows uses some of these APIs, so I'd encourage you to take a look at them.

Let me know if this helps you,
Cheers,
RG

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.