Good day.
I have implemented a Success Handler function called "ReturnsSuccessHandler" for my igHierarchicalGrid in my MVC4 project, in the same manner as described at the end of this article: http://ko.infragistics.com/community/forums/t/66850.aspx
Basically I have a Save function called by a button:
function SaveReturns() {
$("#grdReturns").data("igGrid").dataSource._addChangesSuccessHandler(ReturnsSuccessHandler)
$("body").css("cursor", "wait");
$("#grdReturns").igGrid("saveChanges");
}
Before upgrading my project from IgnuteUI 2014.1 and jQuery 1.7.2 to IgniteUI 2016.1 and jQuery 2.0.3, this was all working i.e. my "ReturnsSuccessHandler" function was being called after save without a problem. Since upgrading, it no longer fires.
Why is this? I cannot see any errors in my console to point me in the right direction. This method is no longer working on 2 views.
Regards
Deon
Hello Deon,
All you have to do is add a second parameter to the "saveChanges" function, which acts as a success callback function. For example:
$("#grdReturns").igGrid("saveChanges", ReturnsSuccessHandler);
Test it yourself and please let me know if it solves your problem.
Regards,Ivaylo HubenovEntry-level developer
Hi Ivalyo,
Sorry but this did not work. I tried:
$("#grdReturns").igGrid("saveChanges", ReturnsSuccessHandler)
and
$("#grdReturns").igGrid("saveChanges", ReturnsSuccessHandler())
as well as removing
as I thought it might conflict, but no luck. Any other ideas? And any idea why it WAS working, but now isn't?
Thanks Ivalyo.
I should also mention that one of the reasons why it was not working was that in my JSon result, I had "success = true" not "Success = true". This was working fine previously i.e. it was registering success.
With this method, I had to make "Success" start with uppercase to register success, otherwise it was returning failure.
Hi Deon,
Since you are using the igHierarchicalGrid, the "saveChanges" function has to be invoked from it:
$("#grdReturns").igHierarchicalGrid("saveChanges", ReturnsSuccessHandler);
If this doesn't work, please attach a sample of your code.