-
Notifications
You must be signed in to change notification settings - Fork 345
Open
Description
I am displaying a grid like this and I have a button. Every time I click this button I want update a specific row lets say with ID:5
$("#clickme").click(function (e) {
//logic to update row with ID 2
});
var clients = [];
for(var i=1;i<=10;i++) {
var client = {ID: i, "Name": "Otto Clay" + i, "Age": 25, "Country": 1, "Address": "Ap #897-1459 Quam Avenue", "Married": false };
clients.push(client);
}
var countries = [
{ Name: "", Id: 0 },
{ Name: "United States", Id: 1 },
{ Name: "Canada", Id: 2 },
{ Name: "United Kingdom", Id: 3 }
];
$("#jsGrid").jsGrid({
width: "100%",
height: "400px",
inserting: true,
sorting: true,
paging: true,
pageIndex: 1,
pageSize: 10,
data: clients,
controller:{
updateItem: function(item) {
console.log(item);
}
},
fields: [
{ name: "Name", type: "text", width: 150, validate: "required" },
{ name: "Age", type: "number", width: 50 },
{ name: "Address", type: "text", width: 200 },
{ name: "Country", type: "select", items: countries, valueField: "Id", textField: "Name" },
{ name: "Married", type: "checkbox", title: "Is Married", sorting: false },
{ type: "control" }
]
});
Metadata
Metadata
Assignees
Labels
No labels