Problem fnSettings().aoColumns has a null value when using FixedColumn

Problem fnSettings().aoColumns has a null value when using FixedColumn

NicoSickNicoSick Posts: 5Questions: 0Answers: 0
edited November 2012 in Plug-ins
Hi all,

I've got a problem on one of my pages with FixedColumn using IE8 (i've no choice about that, sorry :) ).
I've got 5 pages with the exact same code to use DataTable and FixedColumn. 4 of them are working well but for the last one i've got this error message (IE8 dev tools) :
[quote]
Line: 29
Error : 'fnSettings().aoColumns' has a Null value or is not an object.
[/quote]

Here is my code :

[code]
var oTable = $('#ctl00_ContentPlaceHolder2_tab_pdp').dataTable({
// height scroll
"sScrollY": tabMaxHeightPDP() + "px",
// width scroll
"sScrollX": "4060px",
"sScrollXInner": "4060px",
"bScrollCollapse": true,

// pagination
"bPaginate": true,

// show/hide columns
"sDom": 'C<"clear">lfrtip',
"oColVis": {
"aiExclude": [0, 1, 2] // colonnes à ne pas masquer
},

// init sorting
"aaSorting": [[1, "asc"]]
});
new FixedColumns(oTable, {
// three fixed columns
"iLeftColumns": 3,
"iLeftWidth": 560
});
[/code]

Thanks ;)

Replies

  • ulrikeulrike Posts: 39Questions: 1Answers: 0
    Hello,

    What i find strange in your example is that the aoColumns variable does not appear at all in your initialization.
    Maybe you could try to define this variable and see if this helps ?
    Like so :

    [code]
    var aoColumns = new Array();
    $('thead th').each( function () {
    aoColumns.push({ null });
    }

    var oTable = $('#ctl00_ContentPlaceHolder2_tab_pdp').dataTable({
    // height scroll
    "sScrollY": tabMaxHeightPDP() + "px",
    // width scroll
    "sScrollX": "4060px",
    "sScrollXInner": "4060px",
    "bScrollCollapse": true,

    // pagination
    "bPaginate": true,

    // show/hide columns
    "sDom": 'C<"clear">lfrtip',
    "oColVis": {
    "aiExclude": [0, 1, 2] // colonnes à ne pas masquer
    },

    // init sorting
    "aaSorting": [[1, "asc"]]

    // CALL VAR HERE
    ,"aoColumns": aoColumns
    });
    new FixedColumns(oTable, {
    // three fixed columns
    "iLeftColumns": 3,
    "iLeftWidth": 560
    });
    [/code]
  • NicoSickNicoSick Posts: 5Questions: 0Answers: 0
    edited November 2012
    Hi ulrike and thank you for your answer,

    I've just tried your example and it doesn't solve my problem and i got an error on the line
    [code]aoColumns.push({ null });[/code]
    so i removed it and tried to init this value anyway not with success.

    I tried to initialize the aoColumns like that :
    [code]"aoColumns":[null, null,null, etc... ][/code]

    and replacing the "null" thing by a type like i've seen some other place on this forum but i still have this issue.

    If that can help, i have 3 fixed columns and a total of 32 columns in this grid and maybe it's a little bit too big for IE, but i really don't know...
  • NicoSickNicoSick Posts: 5Questions: 0Answers: 0
    edited November 2012
    i've just tried with
    [code] "aoColumns":new aoColumns()[/code]
    but nothing new in IE8...
  • NicoSickNicoSick Posts: 5Questions: 0Answers: 0
    maybe this can help,
    i've managed to find where it's running down :
    [code]this.s={
    dt:a.fnSettings(),
    iTableColumns:a.fnSettings().aoColumns.length,
    etc...
    [/code]
    it's on the first line of the minified version of FixedColumns.
  • NicoSickNicoSick Posts: 5Questions: 0Answers: 0
    Up!
    I still need help on this, please
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Link to a test case please.

    Allan
This discussion has been closed.