【发布时间】:2019-03-18 03:49:43
【问题描述】:
大家好,
如果我的代码中有这个 category.php 文件来执行 CRUD 功能。但是在 Kendo UI 数据源中,我如何在数据源/传输中调用这些函数? 在此之前我曾经拆分过 php 文件,但现在我只想放入一个文件中。 谁能帮我?感谢您的宝贵时间。
<?php
class Categories {
function getCategory(){
//codes in here
}
function addCategory(){
//codes in here
}
function editCategory(){
//codes in here
}
function deleteCategory(){
//codes in here
}
}
?>
transport: {
read: {
url: "./category.php", // <---calling getCategory function
type: "POST",
data: function() {
return {
c1: document.getElementById('c1').checked,
}
},
},
create: {
url: "./category.php", // <---calling addCategory function
type: "POST",
complete: function (e) {
$('#grid').data('kendoGrid').dataSource.read();
}
},
update: {
url: "./category.php", // <---calling editCategory function
type: "POST",
complete: function (e) {
$('#grid').data('kendoGrid').dataSource.read();
}
},
destroy: {
url: "./category.php", // <---calling deleteCategory function
type: "POST",
complete: function (e) {
$('#grid').data('kendoGrid').dataSource.read();
}
},
},
【问题讨论】:
标签: javascript php kendo-ui kendo-grid kendo-datasource