Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
345
igGrid Response from Restful Save failure
posted

I am updating an igGrid with the code below. It works great if there are no database save issues.

Client side (most code eliminated for clarity)

...

.Rest(true)
.RestSettings(rs =>
{
rs.RestSetting()
.Update(u => u.RestVerbSetting()
.Template(Url.Content("~/api/EditBatchAPI?DetailId=${id}"))
.Batch(false) );
})
.Render()

...

It is calling this Server Side:

[HttpPut]
public void Put(int chainPricingDetailId, [FromBody]ChainPricingDetailBrandData value)
{
try
{

...

How can I give feedback to the user if the Put failed?

Parents
  • 29417
    Verified Answer
    Offline posted

    Hello Kenn,

    Thank you for posting in our forum.

    The saveChanges method allows defining a success and an error handler functions:

    https://www.igniteui.com/help/api/2019.2/ui.igGrid#methods:saveChanges

    You can use the error handler, which is triggered when the updating request has failed (for example if the request has resulted in a server side error).

    In it you can show some indication to the user that the updating has failed. For example:

       grid.igGrid("saveChanges", function saveSuccess() {
                    alert("Success");
                }, function saveError() {
                    alert("Error");
                });

     Let me know if you have any additional questions or concerns. 

    Regards,

    Maya Kirova

Reply Children