Uncaught TypeError: Cannot read property 'length' of undefined

Uncaught TypeError: Cannot read property 'length' of undefined

Ramprakash3Ramprakash3 Posts: 5Questions: 1Answers: 0

how to solve this??

Answers

  • Ramprakash3Ramprakash3 Posts: 5Questions: 1Answers: 0

    Uncaught TypeError: Cannot read property 'length' of undefined

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    This means the object you're trying to dereference is undefined, i.e. undefined.fred.

  • Ramprakash3Ramprakash3 Posts: 5Questions: 1Answers: 0

    thanks for reply,
    im using pagination on serverside processing , that time i reached that error, and also pagination not working

  • Ramprakash3Ramprakash3 Posts: 5Questions: 1Answers: 0

    in my dataTable contain,

    serverside:true,

    ajax:{
    url : Myservelt,
    data : {param0:abc,param1:***},
    datasrc :function(xml)
    {
    thisTable.row.add(addingData).draw();
    }
    }

    now i get that error
    ncaught TypeError: Cannot read property 'length' of undefined
    at xb (datatables.min.js:91)
    at datatables.min.js:89
    at i (datatables.min.js:87)
    at Object.success (datatables.min.js:87)
    at i (jquery-3.1.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-3.1.1.min.js:2)
    at A (jquery-3.1.1.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery-3.1.1.min.js:4)

    Thanks

  • kthorngrenkthorngren Posts: 21,301Questions: 26Answers: 4,946

    Please see my response to your other question:
    https://datatables.net/forums/discussion/48284/datatable-serverside-processing-with-xml-data#latest

    Instead of thisTable.row.add(addingData).draw(); you will need to convert the XML data to JSON format then return the converted data in your ajax.dataSrc function. Take a look at the third example in the docs.

    Kevin

This discussion has been closed.