Hello:
I have problem in destroying one row in grid.
Suppose I have one grid with dataSource well configured. In the dataSource.transport we defined read/update/destroy functions that can fetch data, update data and delete data in remote server individually. the code looks like following
$("#grid").kendoGrid({
dataSource: {
transport: {
read: function (e) {
// fetch data from remote server
},
update: function (e) {
// update one record in remote server
},
destroy: function (e) {
// delete one record in remote server
}
},
pageSize: 10,
schema: {
model: {
id: "id",
fields: {
id: {editable: false, nullable: false},
value: {type: "string", editable: true, nullable: false}
}
}
}
},
pageable: {
input: false,
numeric: true
},
height: 400,
scrollable: false,
columns: [
{
field: "id", title: "id", width: "100px"
},
{
field: "value", title: "value"
},
{
command: [
{name:"edit"},
{name:"delete"}
]
}
],
editable: "inline"
});
the question is if we click delete button on one row in grid, and this row will be removed from ui immediately and a delete request defined in dataSource.transport will be sent to remote server. If everything works fine, that's good, but what if remote server rejects the delete request for whatever reason. the result is the record was not deleted from server, but removed from UI. The expected result would be when delete button clicked, UI should wait until response from remote server, if OK, remote record from UI, else show error message
Thanks
I have problem in destroying one row in grid.
Suppose I have one grid with dataSource well configured. In the dataSource.transport we defined read/update/destroy functions that can fetch data, update data and delete data in remote server individually. the code looks like following
$("#grid").kendoGrid({
dataSource: {
transport: {
read: function (e) {
// fetch data from remote server
},
update: function (e) {
// update one record in remote server
},
destroy: function (e) {
// delete one record in remote server
}
},
pageSize: 10,
schema: {
model: {
id: "id",
fields: {
id: {editable: false, nullable: false},
value: {type: "string", editable: true, nullable: false}
}
}
}
},
pageable: {
input: false,
numeric: true
},
height: 400,
scrollable: false,
columns: [
{
field: "id", title: "id", width: "100px"
},
{
field: "value", title: "value"
},
{
command: [
{name:"edit"},
{name:"delete"}
]
}
],
editable: "inline"
});
the question is if we click delete button on one row in grid, and this row will be removed from ui immediately and a delete request defined in dataSource.transport will be sent to remote server. If everything works fine, that's good, but what if remote server rejects the delete request for whatever reason. the result is the record was not deleted from server, but removed from UI. The expected result would be when delete button clicked, UI should wait until response from remote server, if OK, remote record from UI, else show error message
Thanks