ColReorderWithResize is not working with the latest version of Datatables
ColReorderWithResize is not working with the latest version of Datatables
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)
This question has accepted answers - jump to:
Answers
same error here with version 1.10.4
TypeError: oState.aaSorting is undefined
for ( i=0 ; i<oState.aaSorting.length ; i++ )
ColReorderWithResize is a community developed and supported plug-in for DataTables. As far as I am aware it hasn't been actively maintained for quite some time now and has fallen well behind in terms of keeping up with both DataTables core and ColReorder.
I'm sure patches would be welcome if anyone wants to take over the maintenance of it until I get the time to create an offical resizing plug-in.
Allan
Thanks allan, Hope you create the official resize plug-in soon would very much appreciate it, also is there any plans to make grouping plug-in like with drag and drop headers?, I am working on a customized feature to support that but was just wondering if it would be available as an official plug-in any time soon?
Plan to - yes. Soon - unlikely.
I've got a three month roadmap for features I'm planning to add and resizing and row grouping are not on it as I think these other features are more important. Once that is done, I will reassess and look into it then.
Allan
Well, good luck and thanks allan.