【问题标题】:how to use jtable plugin in cakephp and ajax如何在 cakephp 和 ajax 中使用 jtable 插件
【发布时间】:2013-01-20 08:57:45
【问题描述】:

我正在做 cakephp 项目,我正在使用 Jtable A 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.

提前致谢!

【问题讨论】:

    标签: php cakephp url-rewriting routes jquery-jtable


    【解决方案1】:

    是的,我只是通过使用:

    listAction:'/domain/My/getUserPlan'
    

    作为一个动作

    【讨论】:

      猜你喜欢
      • 2023-03-09
      • 1970-01-01
      • 2016-04-01
      • 1970-01-01
      • 2023-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多