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
error in iggridupdatingrowdeleting
posted

Hi,

I am using iggrid in my Angular 2 project,there is something wrong i have written in iggridupdatingrowdeleting

we are using webapi as our backend, the problem i am facing is row get deleted before i have receive error notification from Webapi,in this case record  exists in DB but not in Grid , but  once i refresh  grid  record get back again.

even i have written return false in my catch section but still row get deleted. (autoCommit: true in my grid)

following is the code:

$('#gridProducts').on('iggridupdatingrowdeleting', function (evt, ui) {
var tisdelete="0"//no delete
var tstr:string
if (!confirm("Sure you want to delete ?")) {
return false;
}
else
{
var row = ui.owner.grid.findRecordByKey(ui.rowID);
pthis.http.delete("http://10.10.0.56:88/api/SightPurchases/"+ row.SightPurchaseID)
.map(res => res.status)
.subscribe(val => writelog(val)
,
error => {
// handle error
alert ("Error:While Saving Record, Please Contact Administrator: " )
console.error('this an erreor ' + error.status)
return false
/*$("#gridProducts").igGridUpdating("addRow", {SightPurchaseIDTemp: row.SightPurchaseIDTemp, SightPurchaseID: row.SightPurchaseID,SightMonth:row.SightMonth,EntryDate:row.EntryDate,TailleID:row.TailleID,MakeGroupID:row.MakeGroupID,Note:row.Note,ViewParcels:row.ViewParcels});
*/
})//postserviceended
}); //iggridupdatingrowdeleting


Thanks,
yogesh
Parents Reply Children
No Data