Closed shashank1010 closed 6 years ago
Unable to resize the columns unless I keep ordering option to be true. I do not wish to give sorting abilities to the user using the datatables because I manage that from the server. I have reviewed the issue, will try to document it.
In DataTables 1.10.2 https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L1783 _fnCompatMap( init, 'ordering', 'bSort' ); sets bsort option to be false when i set the ordering option as false.
_fnCompatMap( init, 'ordering', 'bSort' );
This results in the column[n].bsortable option to be false as per https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L2083
With the column[n].bsortable option set to false the plugin cannot set {'cursor': 'col-resize'} on the column, thus disabling the drag and resize functionality of the columns. https://github.com/jeffreydwalter/ColReorderWithResize/blob/master/ColReorderWithResize.js#L960
{'cursor': 'col-resize'}
Possible fix: checking if (!aoColumns[i].bSortable === false || that.s.dt.oFeatures.bSort === false) on https://github.com/jeffreydwalter/ColReorderWithResize/blob/master/ColReorderWithResize.js#L960 Apologies for the long read.
(!aoColumns[i].bSortable === false || that.s.dt.oFeatures.bSort === false)
Thanks for the detailed write up and the PR.
Unable to resize the columns unless I keep ordering option to be true. I do not wish to give sorting abilities to the user using the datatables because I manage that from the server. I have reviewed the issue, will try to document it.
In DataTables 1.10.2 https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L1783
_fnCompatMap( init, 'ordering', 'bSort' );
sets bsort option to be false when i set the ordering option as false.This results in the column[n].bsortable option to be false as per https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L2083
With the column[n].bsortable option set to false the plugin cannot set
{'cursor': 'col-resize'}
on the column, thus disabling the drag and resize functionality of the columns. https://github.com/jeffreydwalter/ColReorderWithResize/blob/master/ColReorderWithResize.js#L960Possible fix: checking if
(!aoColumns[i].bSortable === false || that.s.dt.oFeatures.bSort === false)
on https://github.com/jeffreydwalter/ColReorderWithResize/blob/master/ColReorderWithResize.js#L960 Apologies for the long read.