Server Side Processing not working throwing "Cannot read property 'length' of undefined"

Server Side Processing not working throwing "Cannot read property 'length' of undefined"

princeprince Posts: 2Questions: 1Answers: 0

Hi Alan,

I am trying to populate data table using server side processing but its not working..Trying this for several hours but no luck.I don't know whether i'm missing something.Please help.Here is my datatable debugger url: http://debug.datatables.net/eguwer

HTML table

     <table class="table table-striped table-bordered table-condensed" id="reportTable">
                            <thead>
                                <tr>
                                    <th>Sl.No.</th>
                                    <th>Document Name</th>
                                    <th>Document Type</th>
                                    <th>Authors</th>
                                    <th>Upload</th>
                                    <th>Last Modified</th>
                                    <th>Expiry</th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>

Response JSON

{"iTotalRecords":15,"aaData":[{"expiryDate":"28/03/2015","docName":"7800_standards.pdf","uploadDate":"31/03/2015_10:58:22:284","docType":"PDF Upload","author":"Prince Radhakrishnan","lastModified":"01/04/2015_12:48:49:877","slNo":"1"},{"expiryDate":"24/04/2015","docName":"Fractal_Tiger.jpg","uploadDate":"01/04/2015_12:48:49:877","docType":"Docx Upload","author":"Prince Radhakrishnan","lastModified":"01/04/2015_12:48:49:877","slNo":"2"}],"iTotalDisplayRecords":5,"sEcho":1}

Datatable initialisation

var table = $('#reportTable').dataTable({
                    "sPaginationType": "full_numbers",
                    "bProcessing": true,
                    "bServerSide": true,
                    "bPaginate": true,
                    "bSort": true,
                    "iDisplayLength": 10,
                    "bInfo": true,
                    "sAjaxSource": "generateReportAJAX",
                    "sServerMethod": "POST",
                    "aoColumns": [
                        {"mData": "slNo"},
                        {"mData": "docName"},
                        {"mData": "docType"},
                        {"mData": "author"},
                        {"mData": "uploadDate"},
                        {"mData": "lastModified"},
                        {"mData": "expiryDate"}
                       ]
});

But now, I'm getting Cannot read property 'length' of undefined error in browser.Any help would be appreciated.

Regards,
Prince

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.