Kendo subgrid deletion (with php)
I use example like this:Tutorial for Kendo and PHP
And I use code in subgrid as in grid:
subDS = new kendo.data.DataSource({
transport: {
read: "data/channelName.php?acc="+e.data.userId,
destroy: {
url: "data/chMove.php",
type: "DELETE",
complete: function (e) {
$("#grid").data("kendoGrid").dataSource.read();
}
}
},
error: function(e) {
alert(e.responseText);
},
schema: {
data: "results",
model: {
id: "channelId"
}
}
});
detailRow.find(".subgrid").kendoGrid({
dataSource: subDS,
columns: [
{
title: "Channel Name", field: "channelname"
},
{
command: ["destroy"], title: " ", width: "100px"
}]
});
However, the code isn't fired in server side of PHP code,
I not sure it is client side code wrong or server side?
The read is return:
{"results":[{"channelname":"test"},{"channelname":"5413trret"},{"channelname":"d453"},{"channelname":"test3"},{"channelname":"ter"},{"channelname":"test5"}]}
and userId is in the read of the grid.
The server side(chMove.php) I try to test if it is fired use alert like:
<?php
// determine the request type
$verb = $_SERVER["REQUEST_METHOD"];
echo "<script>alert('"."123"."');</script>";
?>
But the alert never be fired, needless to say I want to get the
parse_str(file_get_contents('php://input'), $request ); later and parse
the $request.
The final goal is delete what user click in the "Delete" button and the
server side can delete it in database.
Any idea about my code? Or is there any other method to do deletion of
subgrid?
Any advice appreciate.
No comments:
Post a Comment