[英]JTable Uncaught TypeError: Cannot call method 'data' of undefined
Will you please help me wht this error occur. 如果发生此错误,请您帮我。 JTable Uncaught TypeError: Cannot call method 'data' of undefined
JTable未捕获的TypeError:无法调用未定义的方法“数据”
Ajax work i got a valid response but it doesnt fetch and shows in the table 我收到了有效的Ajax工作响应,但没有获取并显示在表中
Will you please help me. 请你帮我一下。 In other hand if i script i put it on the sepearate file how can i call this?
另一方面,如果我编写脚本,将其放在单独的文件中,该怎么称呼它?
<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) Likely you are using an older version of jquery - especially if you are using the code that comes with the downloads. 1)可能您正在使用旧版本的jquery-尤其是在使用下载随附的代码时。 I had something similar out of the box and moved to a newer version and the problem went away with no other changes.
我开箱即用时有类似的东西,并移到了较新的版本,问题没有其他变化就消失了。
https://github.com/hikalkan/jtable/issues/953 https://github.com/hikalkan/jtable/issues/953
2) You do not have an ID/primary key - I've been able to add that without making any jquery changes and the table will render. 2)您没有ID /主键-我已经能够添加它而无需进行任何jquery更改,并且表格将呈现。
I don't know if this problem was solved or not but I remind this: 我不知道此问题是否已解决,但我提醒您:
listAction is an object. listAction是一个对象。
change the code like this: 像这样更改代码:
listAction:{
method: *your URL*
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.