Column resize plugin
Column resize plugin
koosvdkolk
Posts: 169Questions: 0Answers: 0
Based on the http://datatables.net/extras/thirdparty/ColReorderWithResize/, I created a Column resize plugin. Can you help me test it?
It can be downloaded from https://github.com/koosvanderkolk/DataTables.columnResizer
1) Make sure the table headers have a right border of about 3px. These borders are the 'handlers' by which the columns can be resized.
2) Put a 'z' in your dataTables config to enable the resizing $(tableElement).dataTable( {"sDom": 'zrtSpi'});
It can be downloaded from https://github.com/koosvanderkolk/DataTables.columnResizer
1) Make sure the table headers have a right border of about 3px. These borders are the 'handlers' by which the columns can be resized.
2) Put a 'z' in your dataTables config to enable the resizing $(tableElement).dataTable( {"sDom": 'zrtSpi'});
This discussion has been closed.
Replies
I guess the obvious issue is with the fact that the table is inherently constrained to the width of the container - so columns basically have a maximum size they can be and reduce the size of other columns. It might be possible to integrate this with x-scrolling, so as columns are made bigger the table will start to x-scroll - likewise if they are made smaller then the table can be smaller than the container. This might be a little trick, and might not always be what is wanted, but possibly an enhancement
Thanks for sharing your work with us - this is really great!
Regards,
Allan
http://live.datatables.net/utagab/5/edit
If would find it more logical to have some setting, e.g. 'enableColumnResizing' or something...
Regarding the 'z' parameter - you are correct it is a little odd, but it the way that feature plug-ins currently work for DataTables. sDom can be used for non-DOM manipulation features such as your own, and Scroller etc, while it can also be used for others such as TableTools etc.
v1.10 will see a bit of work on sDom to make it more intuitive and sensible for this kind of feature.
Regards,
Allan
Cool! :)
I really enjoy this code! However, I am unable to get the statesaving to work... Has it been implemented yet?
Would it also be possible to some how make this compatible with ColReorder? It would ideal to have both of these at the same time :)
Thanks !
It would be nice to make it work.