Uncaught TypeError: Cannot set property 'nTf&#

2020-02-26 14:14发布

I am getting console error "Uncaught TypeError: Cannot set property 'nTf' of undefined". I am using jquery Datatable.

6条回答
混吃等死
2楼-- · 2020-02-26 14:42

Hi I had same problem but now I have fixed my problem. This problem occurs because there are more column in head tag than body tag. If you have same error then first check how many column in thead and tbody or tfoot .

查看更多
爷的心禁止访问
3楼-- · 2020-02-26 14:45

Also, this error occurred for me when the columns in my Datatables setup did not match the columns in my HTML.

I fixed it by making sure they match.

(In the image below, they do not match, which caused the error.)

enter image description here

查看更多
地球回转人心会变
4楼-- · 2020-02-26 14:48

I ran into this problem too. All columns in tfoot matched thead. Just a simple step of clearing browser cache did the magic for me. Hope this helps someone.

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2020-02-26 14:50

Okey Let me just to be clear for everyone , tfoot > th must be equal as your thead > th

i just faced this kind of problem recently and trying to figure it out like couple mins so just make sure in the future someone maybe be faced it

查看更多
走好不送
6楼-- · 2020-02-26 14:57

In your table Check all colspan attribute values if its equal to the number of columns

查看更多
做自己的国王
7楼-- · 2020-02-26 15:00

As per https://datatables.net/forums/discussion/22697/uncaught-typeerror-cannot-set-property-ntf-of-undefined you probably have more cells in the header and/or footer of your table defined in your html than you are getting back from the server.

At least that's the issue I was having which gave me this error message.

查看更多
登录 后发表回答