aoColumnDefs error on bVisible

aoColumnDefs error on bVisible

markjomarkjo Posts: 66Questions: 0Answers: 0
edited September 2013 in General
All my codes work well.
But while initializing table with
[code]$('#myTable').dataTable(
{
"aoColumnDefs":aoColumnDefsType,
}); [/code]

If I add this:
[code]aoColumnDefsType.push({ "bVisible": false, "aTargets": [ 1 ] }); [/code]

I get this error:
[code]Uncaught TypeError: Object [object Object] has no method 'charCodeAt' [/code]

My call stack is like this:
[code] Uncaught TypeError: Object [object Object] has no method 'charCodeAt' jquery.dataTables.js:3757
_fnStringToCss jquery.dataTables.1.9.4.js:3757
_fnCalculateColumnWidths jquery.dataTables.1.9.4.js:3646
_fnInitialise jquery.dataTables.1.9.4.js:2501
(anonymous function) jquery.dataTables.1.9.4.js:6606
jQuery.extend.each jquery-1.9.1.js:648
jQuery.fn.jQuery.each jquery-1.9.1.js:270
DataTable jquery.dataTables.1.9.4.js:6168
startDatatables myjsfile.js:393
(anonymous function) myjsfile.js:120
fire jquery-1.9.1.js:1037
self.fireWith jquery-1.9.1.js:1148
jQuery.extend.ready jquery-1.9.1.js:433
completed jquery-1.9.1.js:103[/code]

What would be the error ?

Replies

  • markjomarkjo Posts: 66Questions: 0Answers: 0
    edited September 2013
    In jquery.datatables.1.9.4.js file I get error at this line:

    [code]
    function _fnStringToCss( s )
    .....
    3756 /* Check if the last character is not 0-9 */
    3757 var c = s.charCodeAt( s.length-1 );
    [/code]

    Error:
    [code]Uncaught TypeError: Object [object Object] has no method 'charCodeAt' [/code]
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Can you please link to a test case as noted in the forum rules, so we can see what is going wrong, debug and address the error.

    My guess is the setting of sType to an invalid option for a column, but I can't say without an example.

    Allan
  • markjomarkjo Posts: 66Questions: 0Answers: 0
    edited September 2013
    Well, from this: http://datatables.net/forums/discussion/11272/uncaught-typeerror-object-object-object-has-no-method-charcodeat/p1

    I found that jquery ui 1.8 conflicts somehow with datatables code.
    When I use jQuery ui 1.10.3, error solved automatically.

    I think there exists some conflict issue between jqueru ui 1.8, jquery 1.91 and datatables 1.9.4
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    jQuery UI 1.8.20- uses a private jQuery method, which they shouldn't have. It breaks something along the way and DataTables sees the result of that. Entirely a jQuery UI bug, not jQuery or DataTables. As you note, upgrading jQuery UI will resolve it.

    Allan
This discussion has been closed.