Hi all,
i'm a bit stuck with the crud functionality in Kendo UI's grid.
My code (see below) generates a populated grid and the neccessary buttons, but i dont seem to be 'binding' the 'save' button to the 'save' functionality in the php file. Can anyone maybe spot what i'm missing please?
Thanks!
Vauneen
dataSource = new kendo.data.DataSource({
transport: {
read: "data/users.php",
create: {
url: "data/user_add.php",
type: "POST"
},
save: {
url: "data/user_edit.php",
type: "POST"
} ,
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
schema: {
data: "data",
model: {
id: "ProductID",
fields: {
ExpiryDate : { editable: true, type: "date"},
EmailAddress : { editable: true, type: "email"},
FirstName : { editable: true, type: "text"},
SecondName : { editable: true, type: "text"}
}
}
}
})
$("#grid").kendoGrid({
dataSource: dataSource,
columns: [{ field: "ID" }, { field: "ExpiryDate", title:"Expiry Date", format: "{0:yyyy-MM-dd}" }, { field: "EmailAddress" }, { field: "FirstName" }, { field: "SecondName" } ],
editable: true,
toolbar: ["create", "save", "cancel"],
detailTemplate: kendo.template($("#template").html()),
detailInit: detailInit
});
i'm a bit stuck with the crud functionality in Kendo UI's grid.
My code (see below) generates a populated grid and the neccessary buttons, but i dont seem to be 'binding' the 'save' button to the 'save' functionality in the php file. Can anyone maybe spot what i'm missing please?
Thanks!
Vauneen
dataSource = new kendo.data.DataSource({
transport: {
read: "data/users.php",
create: {
url: "data/user_add.php",
type: "POST"
},
save: {
url: "data/user_edit.php",
type: "POST"
} ,
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
}
},
schema: {
data: "data",
model: {
id: "ProductID",
fields: {
ExpiryDate : { editable: true, type: "date"},
EmailAddress : { editable: true, type: "email"},
FirstName : { editable: true, type: "text"},
SecondName : { editable: true, type: "text"}
}
}
}
})
$("#grid").kendoGrid({
dataSource: dataSource,
columns: [{ field: "ID" }, { field: "ExpiryDate", title:"Expiry Date", format: "{0:yyyy-MM-dd}" }, { field: "EmailAddress" }, { field: "FirstName" }, { field: "SecondName" } ],
editable: true,
toolbar: ["create", "save", "cancel"],
detailTemplate: kendo.template($("#template").html()),
detailInit: detailInit
});