How to drag Whole column instead of only table header in colReorder?
How to drag Whole column instead of only table header in colReorder?

Hi,
I want to drag whole column instead of column header in datatable as shown in colReorder example.
I want to do something like this:-
http://www.danvk.org/wp/dragtable/
You can move whole column in place of column header in that.
how can it is possible in datatable using colReorder.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Sorry no, This is not currently a feature of ColReorder.
Allan
Ok thanks allan
But is there any way to do it.
by using other api.
No sorry. As I said, that is not a feature that is present in ColReorder at this time. If there was an option for it, I would have mentioned it :-)
Allan
OK Allan Thanks for your reply :)
Hi Allan,
First of all thanks for your quick response.
I appreciate it.
I made some changes in js file and i finally made it.
Please check it.
http://projects.developmentshowcase.com/demo/multilang.php
Fantastic - thanks for sharing this! Happy to accept a pull request with the change, if it supports scrolling tables, which I suspect will be the difficult part.
Allan
Hello Allan,
Thank you so much :).
it will also work in scrolling table, the whole column is moving :- http://projects.developmentshowcase.com/demo/multilang.php
In horizontal scroll, auto scrolling might be a issue but we can find solution of it by using below link:-
https://jsfiddle.net/bababalcksheep/gsf2r1v4/17/
BTW i don't know how to pull request as you said, Sorry for that.
But i am writing a blog regarding of that. I will provide it to you in near time
Sunil Parmar.
Hi Sunil,
Super thanks! The problem with the scrolling aspect is that the whole column is shown on drag. That's not too bad visually in your example with a little bit of scrolling, but it wouldn't look right if there was a lot of content hidden, or the table is scrolled into the middle of the table.
Allan
Hi Allan,
I am back with new query.
I hope you are fine.
I want to do something like on click on the pdf,excel,csv export button or custom button one popup form will open, in that i need to check particular column which are in datatable , after submit the form just only selected columns are allow to export.
Is it feasible.
Can you help me please.
Currently no. There is no way to stop the export buttons from exporting. You would need to modify them in order to perform the conditional logic you require and then save the file.
You could potentially create a custom button that would call the
action
method of the export buttons - that would probably be the easiest way of doing it, but there is no built in way of doing it.Allan
okay, Thanks Allan.
HI Sunil,
I tried to open your link but it wouldn't work. Did you find any solution of this issue?
Thanks
hi allan,
When we drag column can we force th to not move top or bottom of its original area?
can we limit position of th in between blue lines like in image.
Thank you
Currently no, there isn't an option for that I'm afraid. That would require a modification in the source code.
Allan
I made it with few minor source code modifications.
Was pretty simple to do. There may be things I did not thought about, but code presented below served my needs.
Feel free to use that or implement into Datatables/ColReorder source code.
https://pastebin.com/WwbfDuuB