Can't delete row after edit

Hi Syncfusion Team,
I'm editing the grid component by command column. But it has the issue:

After I edit the data of a row, I click the delete icon, and the row will not be deleted, but the data will be reset to the old data before editing, that row is only really deleted when I click the delete icon one more time. 

Link sample: https://stackblitz.com/edit/react-9mvqbp?file=index.js
Step:

  1. Add a new row
  2. Edit the row data
  3. Click delete icon

How can I fix this issue?

Thanks so much. 


3 Replies 1 reply marked as answer

PS Pavithra Subramaniyam Syncfusion Team October 3, 2022 06:06 AM UTC

Hi Ton That Hung,


Thanks for contacting Syncfusion support.


From the sample, we could see that you are performing the CRUD without a primary key column which is mandatory for EJ2 Grid editing. So, we suggest setting a column as a primary key column that should have unique values to overcome the reported issue. Please refer to the below code example and documentation link for more information.


<ColumnDirective

  field="OrderID"

  isPrimaryKey="true"

  headerText="Order ID"

  width="120"

  textAlign="Right"

></ColumnDirective>

 


https://ej2.syncfusion.com/react/documentation/grid/editing/edit/#editing


Please get back to us if you need further assistance on this.


Regards,

Pavithra S


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Marked as answer

TT Ton That Hung October 4, 2022 12:13 PM UTC

Great. Thanks for your support.



PS Pavithra Subramaniyam Syncfusion Team October 5, 2022 09:03 AM UTC

Hi Ton That Hung,


Welcome! Please get back to us if you need further assistance on this.


Regards,

Pavithra S


Loader.
Up arrow icon