Hello,
i have problem with create ,destroy through php
i use POST,PUT and doesn't work
<
div
id
=
"grid"
></
div
>
<
script
type
=
"text/x-kendo-template"
id
=
"tab_frs"
>
<
div
class
=
"tabstrip"
>
<
ul
>
<
li
class
=
"k-state-active"
>
Ville
</
li
>
<
li
>
Détail Pays
</
li
>
</
ul
>
<
div
>
<
div
class
=
"frs"
></
div
>
</
div
>
<
div
>
<
div
class
=
'frs-details'
>
<
ul
>
<
li
><
label
>Libelle:</
label
>#= libelle #</
li
>
<
li
><
label
>Code:</
label
>#= code #</
li
>
</
ul
>
</
div
>
</
div
>
</
div
>
</
script
>
<
script
>
$(document).ready(function() {
var element = $("#grid").kendoGrid({
dataSource: {
pageSize:6,
height: 450,
sortable: true,
pageable: true,
selectable: "row",
resizable: true,
filterable: true,
serverPaging: true,
type: "json",
transport: {
read:{
url: "fic.php?fic=pays",
dataType: "json",
},
update: {
url: "fic.php?fic=up_pays",
type: "POST"
},
create: {
url: "fic.php?fic=add_pays",
type: "PUT"
},
destroy: {
url: "fic.php?fic=des_pays",
dataType: "json",
Type: "POST"
},
},
parameterMap: function(options, operation) {
if (operation !== "read" && options.models) {
return {models: kendo.stringify(options.models)};
}
},
error: function(e) {
alert(e.responseText);
},
schema: {
model: {
id: "IDpays",
fields: {
IDpays: { editable: false, nullable: true },
libelle: { validation: { required: true } },
code: { validation: { required: false} }
}
}
}
},
detailTemplate: kendo.template($("#tab_frs").html()),
detailInit: detailInit,
dataBound: function() {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
toolbar: ["create"],
columns: [{title: "ID", field: "IDpays" },{ field: "libelle" },{ field: "code" },
{ command: ["edit", "destroy"], title: " ", width: "210px" }],
editable: "popup"
});
});
function detailInit(e) {
var detailRow = e.detailRow;
detailRow.find(".tabstrip").kendoTabStrip({
animation: {
open: { effects: "fadeIn" }
}
});
detailRow.find(".frs").kendoGrid({
dataSource: {
type: "json",
transport: {
read: "fic.php?fic=ville"
},
pageSize:6,
filter: { field: "IDpays", operator: "eq", value: e.data.IDpays }
},
scrollable: false,
sortable: true,
pageable: true,
selectable: "row",
resizable: true,
change: function() {
document.getElementById("A1").value=this.dataItem(this.select()).IDContact;
},
columns: [
{ field: "IDville",title:"ID", width: 70 },
{ field: "libelle", width: 100 },]
});
}
</
script
>