'length': object is null or undefined

'length': object is null or undefined

tsmithtsmith Posts: 4Questions: 0Answers: 0
edited May 2011 in Bug reports
Hello, I'm currently using Datatables as a client-side "skin" for my asp.net Gridview control and it works perfectly. Although when I try to attach it to a asp.net Listview control, I get the error below:

Line: 31
Error: Unable to get value of the property 'length': object is null or undefined

I get this error when debugging and in IE9. I don't know what it means and because of this I can't fix it. I ensured that the page html does include a and tags. I actually made the html look exactly like the gridview's html and it still didn't work.

Please help me, I would love to use Datatables again for this application. Thanks.

function pageLoad() {
$('#orders').dataTable({
"aaSorting": [],
"aoColumns": [
{ "bSortable": false, "bSearchable": false },
null,
{ "bSortable": false, "bSearchable": false },
{ "bSortable": false, "bSearchable": false },
{ "bSortable": false, "bSearchable": false },
{ "bSortable": false, "bSearchable": false },
{ "bSortable": false, "bSearchable": false }
]
});
};

Replies

  • tsmithtsmith Posts: 4Questions: 0Answers: 0
    For those who are interested, I was able to solve my problem. Length was related sType so the solution below solved my issue. Because of this I was able to use Datatables and apply them against an asp.net Listview control. Awesome tool.

    function pageLoad() {
    $('#orders').dataTable({
    "bSort": false,
    "bAutoWidth": false,
    "aoColumns": [
    { "sType": "string" },
    { "sType": "string" },
    { "sType": "string" },
    { "sType": "string" },
    { "sType": "string" },
    { "sType": "string" },
    { "sType": "string" }
    ]
    });
    };
  • allanallan Posts: 61,694Questions: 1Answers: 10,102 Site admin
    Which version of DataTables were you using? If the 1.8 development images I'd be most interested in seeing your table with this error occurring so I can address the issue.

    Thanks,
    Allan
  • tsmithtsmith Posts: 4Questions: 0Answers: 0
    DataTables-1.7.6 version







    Name


    Plan


    Objective


    Step


    Note


    Due Date










    Simpson, Lora








    Schizzna, Lora






    I'm guessing it has something to do with "colspan" attribute.
  • allanallan Posts: 61,694Questions: 1Answers: 10,102 Site admin
    Ah yes - that would do it. DataTables doesn't currently have any support for colspan or rowspan in the TBODY element - sorry. The main reason is that columns and rows are treated independently - thus each cell must be 'resolvable' (required for sorting, filtering etc).

    Allan
This discussion has been closed.