IgniteUI / ignite-ui

Ignite UI for jQuery by Infragistics
https://bit.ly/2kuu1fT
Other
477 stars 84 forks source link

SaveChanges callback function on a hiearchical grid #2228

Closed IsiAymeric closed 3 months ago

IsiAymeric commented 1 year ago

Description

Describe the issue.

I'm trying to use the .igHierarchicalGrid("saveChanges", success, error) function and i think I've hit bug. When I use this function in a rest context it saves the changes correctly but callback functions are not called. After a bit of investigation in your code I found that the method_saveChangesForEachGrid() is called without parameter, but it has the success, error parameter in its definition:

Extract from the igHierarchicalGrid savechanges : ... var self = this, opts, elem = self.element, url = self.options.updateUrl, taLog = []; if ((this.options.rest || this.options.odata) && this.options.restSettings) { this._saveChangesForEachGrid(); return; ... } _saveChangesForEachGrid definition: ... _saveChangesForEachGrid: function (success, error) { // will call each of the open layouts save changes instead of one full transaction log this.rootWidget().saveChanges(success, error); $.each(this.allChildrenWidgets(), function () { this.saveChanges(success, error); }); }, …

Steps to reproduce

  1. Create a Rest igHierarchicalGrid
  2. Enable RestSetting for update on each level
  3. Modif some data
  4. Call the .igHierarchicalGrid("saveChanges", function() {console.log("OK")},, function() {console.log("KO")});

Result

None of the callbacks are called.

Expected result

Callback functions should be called if sucess or error.

Question :

As I wait for a Fix can I modify the : if ((this.options.rest || this.options.odata) && this.options.restSettings) { this._saveChangesForEachGrid(); return; to if ((this.options.rest || this.options.odata) && this.options.restSettings) { this._saveChangesForEachGrid(sucess,error); return; ? Thanks

dkamburov commented 3 months ago

Fix was merged to the code base