解决dataTable 报错:cannot read property "style" of undefined
2017-08-16 17:48
246 查看
其实这错,我之前也遇到过,只是太久了,没有记录下来,
今天看到群里朋友也遇到这个错误,于是记录一下,报错如图:
我之前遇到的原因是,表中列名字段和控制器中设置的属性名字不一致。
如图:roleDesc 属性一定要和后台代码取名一致。
jsp 页面:
后台代码:
今天看到群友的情况是后台传送的 json 格式不对,正确的格式一定要有中括号 :[ ] 。
正确 json 格式 demo 如下:
以此记录,如果还有不同情况的,希望各位萝卜多多留言,谢谢。
相关文章推荐
- 【datatable】Cannot read property 'style' of undefined问题解决
- Android webview解决JS报错chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'getItem'
- jQuery 出现Cannot read property ‘msie’ of undefined错误的解决方法
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
- Cannot read property "style" of null 诱因之一
- [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法
- [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法
- Hexo:如何解决 FATAL Cannot read property 'code' of undefined
- 解决antd Cannot read property 'validate' of undefined
- TypeError: Cannot read property 'style' of null 错误解决
- d3.js关于比例尺报Cannot read property 'linear' of undefined错误的解决方法
- 【jQuery】Cannot read property ‘msie’ of undefined错误的解决方法
- [jQuery1.9]Cannot read property ‘msie’ of undefined错误的解决方法
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
- zTree Cannot read property 'init' of undefined的一种解决方式
- [jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
- 浏览器cannot read property 'msie' of undefined的解决方法
- 浏览器cannot read property 'msie' of undefined的解决方法