I have the following kendo grid, after update I want my grid to be refreshed again, from datasource,but does not work with the following approach im not sure if imm putting the refresh datasource command in the right place,any help will be highly appreciated
dataSource = new kendo.data.DataSource({
transport: {
read: function (options) {
options.success(result); // where data is the local data array
},
update: function (options) {
$.ajax({
type: "POST",
url: "/AdminTool/update_grid",
data: options.data.models[0],
dataType: "json",
success: function (data) {
options.success(data);
// alert("success");
$("#turbingrid").data("kendoGrid").dataSource.read();
},
error: function (data) {
options.error(data);
// alert("error");
},
});
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
}
},
batch:true,
pageSize: 40,
schema: {
//data: employee,
model: {
id: "DeviceIP",
fields: {
DeviceIP: { editable: false, nullable: true },
//Producer: { type:"string" },
//3 Model: { type: "string" },
DeviceType:{ type:"string" },
Description:{ type:"string" },
Username:{ type:"string" },
Password:{ type:"string" },
PublicIP: { type: "string" },
ModelProducer: { type: "string" },
TurbineId: {type:"string"}
//UnitPrice: { type: "number", validation: { required: true, min: 1} },
//Discontinued: { type: "boolean" },
//UnitsInStock: { type: "number", validation: { min: 0, required: true } }
}
}
}
});