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%',
autoCommit: 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: "15%" },
{ headerText: "City", key: "City", dataType: "string", width: "25%" },
//make template to add row on cell click event
{ headerText: "Add Row On Cell Click", key: "AddRow", dataType: "string", width: "35%", template: "<p style='text-align: center; margin: 0; font-weight: bold;'>add</p>"},
],
autofitLastColumn: false,
autoGenerateColumns: false,
dataSource: data,
responseDataKey: "results",
features: [
{
name: "Filtering",
type: "local",
},
{
...