简体   繁体   English

JTable未捕获的TypeError:无法调用未定义的方法“数据”

[英]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.

相关问题 未捕获的TypeError:无法读取未定义的属性“数据” - Uncaught TypeError: Cannot read property 'data' of undefined Javascript错误“未捕获的TypeError:无法调用未定义的方法&#39;submit&#39;”是什么意思? - What is meant by Javascript error “Uncaught TypeError: Cannot call method 'submit' of undefined”? 未捕获的类型错误:无法读取未定义的属性“SearchBox” - Uncaught TypeError: Cannot read property 'SearchBox' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;textContent&#39; - Uncaught TypeError: Cannot read property 'textContent' of undefined 未捕获的类型错误:无法读取未定义的属性“提交” - Uncaught TypeError: Cannot read property 'submit' of undefined 未捕获的TypeError:无法读取未定义的属性&#39;ChartWrapper&#39; - Uncaught TypeError: Cannot read property 'ChartWrapper' of undefined 未捕获的TypeError:无法设置未定义的属性“操作” - Uncaught TypeError: Cannot set property 'action' of undefined 未捕获的TypeError:无法读取未定义的属性“ length” - Uncaught TypeError: Cannot read property 'length' of undefined ......未捕获的类型错误:无法读取未定义的属性“登录” - ......Uncaught TypeError: Cannot read property 'login' of undefined 未捕获的TypeError:无法读取未定义的属性“mData” - Uncaught TypeError: Cannot read property 'mData' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM