I am trying to get newly inserted rowdata(cell values) from endadd event of grid and trying to send it to webapi. I look every where in documentation but not find any way to process the args parameter. Below are code snippets.
var dataManager = ej.DataManager({
url: "http://localhost:1895/api/customer",
crossDomain: true,
adaptor: new ej.WebApiAdaptor(),
offline: true,
});
$("#grid").ejGrid({
dataSource: dataManager,
//allowFiltering: "true",
allowResizing: "true",
endAdd: senddatatoserver, // endadd event handler
allowGrouping: "true",
isResponsive: "true",
allowResizeToFit: "true",
allowPaging: "true",
allowScrolling: "true",
allowSorting: "true",
allowReordering: "true",
recordClick: function getInfo(args) {
if (args.target.classList.contains("e-rowcell")) {
console.log(this.ej2_instances[0].getRowInfo(args.target)); // for getting row info based on click
}
},
allowMultiSorting: "true",
allowSearching: "true",
enableResponsiveRow: "true",
contextMenuSettings: {enableContextMenu: true},
enableHeaderHover: "true",
enableAltRow: "true",
enableRowHover: "true",
scrollSettings: {width: screen.availWidth},
pageSettings: {pageSize: 10},
editSettings: {allowAdding: "true", allowDeleting: "true", allowEditing: "true"},
toolbarSettings: {
showToolbar: true,
toolbarItems: [ej.Grid.ToolBarItems.Add, ej.Grid.ToolBarItems.Edit, ej.Grid.ToolBarItems.Delete, ej.Grid.ToolBarItems.Search, ej.Grid.ToolBarItems.Update, ej.Grid.ToolBarItems.Cancel]
},
var func = function senddatatoserver(args) {
$("#dialog").ejDialog(
{
actionButtons: ["close"],
title: "Record added",
}
);
$("#addcontent").text("Row Inserted Succesfully" + a);
//how to process args to get newly inserted row and send to the webapi as post request.
};