Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35288

ColReorderWithResize is not working with the latest version of Datatables

$
0
0

Hi, I can't seem to find a solution to this whenever i bring the latest version of ColReorderWithResize and Datatables together it just breaks giving this error: Uncaught TypeError: Cannot read property 'length' of undefined

The problem seems to be at line 901 which exists under the _fnStateSave function

"_fnStateSave": function (oState) {
        var i, iLen, aCopy, iOrigColumn;
        var oSettings = this.s.dt;

        /* Sorting */
        for (i = 0; i < oState.aaSorting.length; i++) {
            oState.aaSorting[i][0] = oSettings.aoColumns[oState.aaSorting[i][0]]._ColReorder_iOrigCol;
        }

        var aSearchCopy = $.extend(true, [], oState.aoSearchCols);
        oState.ColReorder = [];
        oState.ColSizes = [];

        for (i = 0, iLen = oSettings.aoColumns.length; i < iLen; i++) {
            iOrigColumn = oSettings.aoColumns[i]._ColReorder_iOrigCol;

            /* Column filter */
            oState.aoSearchCols[iOrigColumn] = aSearchCopy[i];

            /* Visibility */
            oState.abVisCols[iOrigColumn] = oSettings.aoColumns[i].bVisible;

            /* Column reordering */
            oState.ColReorder.push(iOrigColumn);

            /* Column Sizes */
            oState.ColSizes[iOrigColumn] = oSettings.aoColumns[i].sWidth;
    }
}

When i inspected i found out that the oState object does not have any of the following aoSearchCols, aaSorting or abVisCols, I am stuck because column reordering and column resizing are two required features for my application and i can't find a way to work around this so please help me fix this :).

Datatables version: 1.10.3
ColReorderWithResize version: 1.1.0-dev2 (based on commit 2a6de4e884 done on Feb 22, 2013)


Viewing all articles
Browse latest Browse all 35288

Trending Articles