2014-03-25 63 views
0

请您帮助我解决这个错误。 JTable中遗漏的类型错误:无法调用未定义JTable未捕获类型错误:无法调用未定义的方法“数据”

阿贾克斯工作法“数据”我得到了一个有效的回应,但它并不在表

获取和显示。请你帮帮我。另一方面,如果我脚本我把它放在sepearate文件,我怎么能这样称呼它?

<div id="church_list" style="width: 600px;"></div> 

<script type="text/javascript"> 
    $(document).ready(function() { 

     //Prepare jTable 
     $('#church_list').jtable({ 
      title: 'Church List', 
      paging: true, 
      pageSize: 20, 
      sorting: true, 
      defaultSorting: 'church_name ASC', 
      actions: { 
       listAction: server_path+'/superadmin/?a=listChurch' 
      }, 
      fields: { 
       church_name: { 
        title: 'Church Name', 
        width: '30%' 
       }, 
       church_city: { 
        title: 'Church City', 
        width: '20%' 
       }, 
       church_state: { 
        title: 'Church State', 
        width: '20%' 
       }, 
       payment_type: { 
        title: 'Payment Type', 
        width: '20%' 
       }, 
       training_cost: { 
        title: 'Training Cost', 
        width: '20%' 
       } 
      } 
     }); 

     //Load person list from server 
     $('#church_list').jtable('load'); 

    }); 

</script> 
+1

所以这是在一些随机插件内部错误,并且希望我们的数字出来? – adeneo

+0

{“Result”:“OK”,“TotalRecordCount”:50,“Records”:[{“church_name”:“Test”,“church_city”:“Test”,“church_state”:“TEST”,“payment_type” “Test”,“training_cost”:“10.00”}]} – user2617449

+0

是的,我不知道它为什么会发生? – user2617449

回答

0

1)可能你使用的是jquery的老版本 - 尤其是如果你使用的是下载的代码。我有一些类似的东西开箱即用,并且转移到了更新的版本,问题消失了,没有其他更改。

https://github.com/hikalkan/jtable/issues/953

2)你没有一个ID /主键 - 我已经能够添加不作任何jQuery的变化和表将呈现。

0

我不知道这个问题已经解决或没有,但我提醒这一点:

的listAction是一个对象。

改变这样的代码:

listAction:{ 
    method: *your URL* 
} 
相关问题