[英]how to use jtable plugin in cakephp and ajax
我正在Cakecake项目上工作,在这里我使用Jtable一个JQuery插件来创建基于AJAX的CRUD表。 我正在从访问数据:
localhost/mydomain/ControllName/functionName i.e
localhost/mydomain/My/getUserPlan
我已经通过以下方式进行了操作,但是将相同的页面网址作为操作
这是我的代码:
$('.list-of-location').jtable({
title: 'Table of location',
actions: {
getUserPlanAction:'/My/getUserPlan' // It is not used by Jtable, instad taking same page url
},
fields: {
arrivaldate:{
title: 'From',
width: '40%'
},
departuredate: {
title: 'To',
width: '40%',
key: true,
create: false,
edit: false,
list: false
},
country: {
title: 'Destination',
width: '40%'
},
regular_cost:{
title: 'reguler budget',
width: '20%'
},
backpacker_cost: {
title: 'low budget',
width: '30%',
type: 'date',
create: false,
edit: false
}
}
});
$('.list-of-location').jtable('load');
任何想法我该如何采取行动。 我也尝试过:
1)getUserPlanAction:'getUserPlan'
2)getUserPlan:'/ My / getUserPlan'
3)getUserPlan:“ getUserPlan”
4)动作:'/ My / getUserPlan'
作为一项动作,但这些都不起作用且出现错误:
An error occured while communicating to the server.
提前致谢!
是的,我只使用以下命令就可以正常工作:
listAction:'/domain/My/getUserPlan'
作为行动
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.