BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
@(Html.EJ().Grid<emp.Models.UseDocLineModel>("FlatGrid") .Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.dataSource).UpdateURL("Update").InsertURL("NormalInsert").RemoveURL("DeleteLine").Adaptor(AdaptorType.RemoteSaveAdaptor)) . . . . . . . . .ClientSideEvents(eve => { eve.ActionBegin("begin").ActionComplete("complete");}) ) <script type="text/javascript"> function begin(args) { if (args.requestType == 'delete') { args.model.dataSource.dataSource.headers = []; args.model.dataSource.dataSource.headers.push({ "additional_key": args.data.document_code, "additional_key1": args.data.document_no, "additional_key2": args.data.line_no });
} } function complete(args) { if (args.requestType == 'delete') args.model.dataSource.dataSource.headers = [];//to avoid headers value to be interfered with other actions, emptied the Headers } //Perform delete public ActionResult DeleteLine(int key //primarykey value) {
NORTHWNDEntities db = new NORTHWNDEntities(); //getting additional key values string obj = Request.Headers.GetValues("additional_key")[0]; //key1 int obj1 = Int32.Parse(Request.Headers.GetValues("additional_key1")[0]); //key2 int obj2 = Int32.Parse(Request.Headers.GetValues("additional_key2")[0]); //key3 . . . . . . . . //code for delete the record return Json(docLines, JsonRequestBehavior.AllowGet); |