asp.net mvc - jQuery Datatables Cannot read property 'length' with option bProcessing=true -
this works fine:
<table id="datatable"> <thead> <tr> <th> title </th> <th> creator </th> <th> subjects </th> <th></th> </tr> </thead> </table> <script type="text/javascript"> $(document).ready(function () { $('#datatable').datatable({ "sdom": 'ft<"bottom clear"ip><"clear">', "bserverside": true, "idisplaylength": 10, //"bprocessing":true, "sajaxsource": '@url.action("getmessages","performance")', "aocolumns": [ { "sname": "title" }, { "sname": "creator" }, { "sname": "subject" }] }); }); </script>
if uncomment line "bprocessing:true" exception uncaught typeerror: cannot read property 'length' of undefined jquery.datatables.min.js:65
the code exception throw doesn me
function e(a, b) { if (a.ofeatures.bprocessing) (var c = **a.aanfeatures.r**, d = 0, = c.length; d < i; d++) c[d].style.visibility = b ? "visible" : "hidden"; h(a.oinstance).trigger("processing", [a, b]) }
a.aanfeatures exist, a.aanfeatures.r undefined. action in performance controller doesn't called.
anyone?
a couple of things stand out:
there no <tbody></tbody>
in table - add after </thead>
.
in <thead>
section have 4 <th>
cells; in aocolumns section, three. how many columns ajax call returning? number of columns returned should agree.
Comments
Post a Comment