table.js:2 Uncaught TypeError: Cannot create property ‘LAY_TABLE_INDEX’ on number ‘1’
Using the data table of the layui framework, render errors
Reason: when layui renders table data, the data value returned by the interface request should be in the form of * data: [{}, {}, {}], while my data form is in the form of data: {data: [{}, {}], statuscode: 1,…} *, so an error will be reported
Solution: parse the data in the parsedata function
table.render({ elem: ' ' ,url: ' ', parseData: function(res){ console.log('Return Values',res) return { "statusCode": res.statusCode, //Analyze interface status "data": res.data.data //Parse the data list }; },`
Similar Posts:
- [Solved] layui Error: “layui.js:4 Uncaught TypeError: Cannot create property ‘LAY_TABLE_INDEX’ on string ……”
- How to console.log in React application using JSX ?
- Uncaught Error: _registerComponent(…): Target container is not a DOM element
- Uncaught SyntaxError: Unexpected token o
- [Solved] Uniapp Axios appears in wechat applet index.js? [SM]: 33 errortyerror: l is not a function error
- Python Error:Exception Value:can only concatenate str (not “bytes”) to str
- Solve the problem of “typeerror: ‘bool’ object is not callable” in flash and Django
- [Solved] Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse
- Ajax submitting datagram in firebox_ ERROR_ DOCUMENT_ NOT_ Cached error
- [Django CSRF tutorial] solve the problem of forbidden (403) CSRF verification failed. Request aborted