Data Source not changed after Normal Edit Mode

Hi 

I am using Normal editmode and Single Click to start the edit like this:

load: function () {
      this.$refs.grid.ej2Instances.element.addEventListener(
        "mouseup",
        function (e) {
          var instance = this.ej2_instances[0];
          if (e.target.classList.contains("e-rowcell")) {
            if (instance.isEdit) instance.endEdit();
            let index = parseInt(e.target.getAttribute("Index"));
            instance.selectRow(index);
            instance.startEdit();
          }
        }
      );
    },

Also I am not using the toolbar and disable the showConfirmDialog:

editSettings: {
        allowEditing: true,
        showConfirmDialog: false,
        allowAdding: false,
        allowDeleting: false,
        mode: "Normal",
      },

But somehow, the Datasource not changes after I edit the data in grid.

Is it because i didn't confirm the changes? How can i make those changes apply to the datasource?


3 Replies

PS Pavithra Subramaniyam Syncfusion Team November 18, 2021 01:31 PM UTC

Hi Fan, 

By default, while focus out the edit form with updated values it will automatically make the changes in original Grid dataSource. And for “Normal” edit mode it is not necessary to set the “showConfirmDialog” property which is used for “Batch” edit confirmation. Please refer to the below sample for more information. 


If you are still facing the issue, could you please share the below details that will be help full for us to provide a better solution. 

  1. Share the full Grid code
  2. How did you check the Grid dataSource changes?
  3. How you save the edited records(by clicking outside, pressing enter key or any programmatical way)

Regards, 
Pavithra S 



FZ Fan Zhang November 18, 2021 08:36 PM UTC

I changed back to double click event to enable the edit, everything works fine.


Thanks

Fan



PS Pavithra Subramaniyam Syncfusion Team November 19, 2021 10:24 AM UTC

Hi Fan, 

It's great to hear that you have overcome your issue! Please get back to us if you have any other queries. 

Regards, 
Pavithra S 


Loader.
Up arrow icon