DRAGABLE HORIZONTAL
DRAGABLE HORIZONTAL
lauromneto
Posts: 129Questions: 0Answers: 0
Good afternoon sirs.
Please, has anyone managed to implement or know how to implement dragable horizontal scroll on datatable?
This discussion has been closed.
Replies
Are you referring to the
scrollX
option? See this example:https://datatables.net/examples/basic_init/scroll_x.html
Kevin
Good afternoon Kevin This I am already using.
What I'm trying to do and DATATABLE ONLY I'm not getting is to make the dragable, that is, I click on the table, holding it clicked, I drag to the right and left.
That's exactly what I need.
https://stackoverflow.com/questions/39382901/drag-table-or-other-content-horizontally-in-scrollable-div
In Datatable everything is difficult, complicated to implement, simple things to solve in Datatable, we suffer, get screwed to work. I've been trying to make this work on the datatable since morning and nothing !!!! My God !!!!!
There is still the question of the date there from the Editor that until now has not been resolved.
Difficult it saw! For the love of God !!!!!
I see, you want to click anywhere in the table and drag it left or right. I took the solution presented and placed it in this test case using Editor and select:
http://live.datatables.net/guwafemu/81/edit
Only made 2 changes to the CSS in the solution for the
div
to take 100% width.Kevin
PERFECT KEVIN !
Thank you !
Now we just need to resolve the date issue. rs rs
If you can help me, I'm also trying ...
The dragable issue, I had solved it this way:
Sorry, I don't use nor know enough about PHP to be helpful.
Kevin
Ah yes .... I am waiting for Allan.
I tried your solution from the SO thread and it works but has a couple issues.
http://live.datatables.net/rirequqi/1/edit
Maybe it behaves correctly in your environment but in the test case it sometimes can highlight cells. If you scroll off the table the
curDown
flag is not reset so if you move the mouse over the table without the mouse button being down it will still scroll. I use thecenter-div
class to size the table to show this. Probably can fix both issues.The neat thing about your solution is that if you enable
scrollY
you can drag the table vertically too.I updated my test case to move the draggable
div
to be placed around thetable
only so the table is all that scrolls. This is done using thedom
option to wrap the table in adiv
with the classesbox
anddrag
. This doesn't usescrollX
. It doesn't seem to have the two issues I see in the other example. Seems to be a simpler solution.http://live.datatables.net/nibicufa/1/edit
Kevin
BTW, that SO thread was a good find!
Kevin
Good morning Kevin. Thanks for the answer and explanation. I actually followed an example I saw from another case on the Internet and changed it.
But your solution was that I used it here too.
Thank you.
Ah! In that case, when dragging the table causes the selection of some cells, you solve with this:
This solution by kthorgren was perfect for my issue too
http://live.datatables.net/guwafemu/81/edit
I just had to add
at the beginning of the initComplete to avoid errors in console
and forced table to be 100%.
Thanx!