Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
145946 | Jul 15,2019 01:53 PM UTC | Jul 17,2019 09:19 AM UTC | jQuery | 3 |
![]() |
Tags: ejGrid |
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.
};
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.