JavaScript
var data = [
{ "ID": 1, "Name": "Nancy", "LastName": "Davolio", "Age": 26, "City": "Detroit" },
{ "ID": 2, "Name": "Andrew", "LastName": "Fuller", "Age": 27, "City": "Kanzas" },
{ "ID": 3, "Name": "Janet", "LastName": "Leverling", "Age": 24, "City": "New York" },
{ "ID": 4, "Name": "Margaret", "LastName": "Peacock", "Age": 29, "City": "Detroit" },
{ "ID": 5, "Name": "Steven", "LastName": "Buchanan", "Age": 25, "City": "Washington" },
{ "ID": 6, "Name": "Michael", "LastName": "Suyama", "Age": 23, "City": "Miami" },
{ "ID": 7, "Name": "Robert", "LastName": "King", "Age": 21, "City": "Las Vegas" },
{ "ID": 8, "Name": "Laura", "LastName": "Callahan", "Age": 27, "City": "Las Angeles" }
];
$(function () {
$("#grid").igGrid({
primaryKey: "ID",
width: '100%',
autocomit: true,
columns: [
{ headerText: "ID", key: "ID", dataType: "number", width: "10%" },
{ headerText: "First Name", key: "Name", dataType: "string", width: "25%" },
{ headerText: "Last Name", key: "LastName", dataType: "string", width: "25%"},
{ headerText: "Age", key: "Age", dataType: "number", width: "25%" },
{ headerText: "City", key: "City", dataType: "string", width: "25%" }
],
autofitLastColumn: false,
autoGenerateColumns: false,
dataSource: data,
responseDataKey: "results",
features: [
{
name: "Updating",
enableAddRow: true,
editMode: "row",
enableDeleteRow: true,
rowAdding: function(evt, ui){
//get the data
var ds = ui.owner.grid.dataSource;
//get the primary key
var pk =...