Way to set sScrollX dynamically?

Way to set sScrollX dynamically?

Govi74Govi74 Posts: 2Questions: 0Answers: 0
edited May 2011 in General
Is there a way to set the sScrollX dynamically?
Say, if I have more than 7 columns, then I need to set the sScrollX and then FixedColumn, else, I want the defaults.

Replies

  • Govi74Govi74 Posts: 2Questions: 0Answers: 0
    Managed to get it done as follows.. FixedColumns were messing up with unnecessary scrollbars even when the number of columns were able to fit in. So eliminated FixedColumns if the columns are less than some.
    [code]
    matTable = $('#resultMatrix').dataTable(...
    "sScrollX": "100%",
    });

    var tSettings = matTable.fnSettings();
    if (tSettings.aoColumns.length > 10 ) {
    new FixedColumns(matTable);
    }
    [/code]
    Hope there is something better.
This discussion has been closed.