Object Doesn't support property or method: v1.5 beta 11

Object Doesn't support property or method: v1.5 beta 11

alinwrkshpalinwrkshp Posts: 2Questions: 0Answers: 0
edited July 2009 in General
Hi Allan,

The below code runs fine in v1.4.3 but when i swap out the .js file with v1.5 beta 11 i get the above error message on line: 514 Char: 4.

Do I need to add an option or something to get this working again with the new beta version?

thx for any help!!
Justin
[code]
jQuery(document).ready(function(){
var mystr ="[[ '1234', 'TEST1', 1111111, 222222, 3333 ],[ '1234', 'TEST2', 1111111, 222222, 3333 ]]";
$('#grid').dataTable( {
"aaData": eval(mystr) ,
"aoColumns": [
{"sTitle": "Column1"},
{"sTitle": "Column2"},
{"sTitle": "Column3"},
{"sTitle": "Column4"},
{"sTitle": "Column5"}
]
});


...






Column1
Column2
Column3
Column4
Column5






[/code]

Replies

  • allanallan Posts: 63,494Questions: 1Answers: 10,470 Site admin
    Hi alinwrkshp,

    Thanks very much for posting your code here. It's really helped get to the bottom of what I believe has been the root cause of a number of questions posted today :-).

    The problem comes when a non-string variable is given to _fnAddData() (an internal function used for parsing the JS array you pass in). What you are doing is 100% correct, and there is a bug in DataTables there - nice find! To fix it add the following at line 506 (inside the first function in _oExt.aTypes).

    [code]
    /* Snaity check that we are dealing with a string */
    if ( typeof sData.charAt != 'function' )
    {
    return null;
    }
    [/code]

    And that cures the problem. I'll make sure that this goes into the next release (likely to be 1.5 final).

    Regards,
    Allan
  • alinwrkshpalinwrkshp Posts: 2Questions: 0Answers: 0
    Thanks for the quick fix! That got me back up and running again!!

    Keep up the great work! This is an tremendously useful tool!!
    Justin
This discussion has been closed.