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
360
Help need for Iggrid Insert/update/delete & Edit cancel.
posted

Hi,

  Currenly,i am facing  following issue:

1) for insert,update,delete: 

  we are using WEBAPI in our project, if any error occurs while making Insert,Update,Delete, WebApi Returning that Error string.  but currently if any error occures at webapi  , Igrrid still insert,update,delete that respective record into the grid .

 with  help of Error string, how can i restrict iggrid to

  a).add new row with that record,

  b).update existing record,

  c).delete record

2). i am using ('iggridupdatingeditrowended', function (evt, ui){} for update, but if i have click on cell for edit and click on cancel button without editing any field, still  ('iggridupdatingeditrowended', function (evt, ui){} event  get fired , it should get fire only when i would click on Done button.

 

  Thanks,

  Yogesh

 

Parents
  • 5513
    Offline posted

    Hello Yogesh,

    Regarding error handling with WebAPI, the answer may depend on how you have set your restSettings and at which point you call saveChanges but in general, you will want to disable auto-committing (autoCommit: false) then call saveChanges with both a success and an error callback. In the success callback you should call a manual commit so that the change gets persisted in the local data source. In the error callback you should rollback the faulty edit.

    By design the editRowEnded event gets fired when editing for a row ends, regardless of the result. Should you want to detect if the end-user wanted to persist the change (by clicking the Done button or hitting Enter) or not (Cancel/Esc) you should use the event argument "update" as listed in the API reference.

    I hope this helps! Thank you for using Infragistics forums!

    Please, let me know if you have any other questions or concerns!

    Best regards,

    Stamen Stoychev

Reply Children