Horizontally dragabble datatable
See original GitHub issueFeature Request
Horizontally srcollable datatable’s
Have you already implemented a prototype solution, for your own project?
Yes
Do you see this as a core feature or an add-on?
Core feature
Code:
vendor\backpack\crud\src\resources\views\crud\inc\datatables_logic.blade.php
.......
dataTableConfiguration: {
initComplete: function () {
var tableBody = document.querySelector ('.dataTables_scrollBody');
var headerTable = document.querySelector ('.dataTables_scrollHead');
var curDown = false;
var oldScrollLeft = 0;
var oldScrollTop = 0;
var curXPos = 0;
var curYPos = 0;
if (tableBody) {
tableBody.addEventListener ("mousemove", function (e) {
if (curDown === true) {
tableBody.scrollLeft = oldScrollLeft + (curXPos - e.pageX);
headerTable.scrollLeft = oldScrollLeft + (curXPos - e.pageX);
tableBody.scrollTop = oldScrollTop + (curYPos - e.pageY);
}
});
tableBody.addEventListener ("mousedown", function (e) {
curDown = true;
e.target.style.cursor = 'grab';
curYPos = e.pageY;
curXPos = e.pageX;
oldScrollLeft = tableBody.scrollLeft;
oldScrollTop = tableBody.scrollTop;
});
tableBody.addEventListener ("mouseup", function (e) {
e.target.style.cursor = 'initial';
curDown = false;
});
tableBody.addEventListener ("scroll", function (e) {
headerTable.scrollLeft = tableBody.scrollLeft;
});
}
},
..................
@if ($crud->getResponsiveTable())
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
DRAGABLE HORIZONTAL — DataTables forums
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,...
Read more >javascript - How to get table body to be draggable towards ...
I have a very long table with lots of data with a horizontal overflow. The problem is that the user needs to scroll...
Read more >Drag-and-drop with Datatable - UI Widgets - Webix
Drag -and-drop with Datatable. The library supports drag-and-drop of items from and to a table. Moving rows. To enable the drag-and-drop support for...
Read more >Beautiful Styling for Drag-and-Drop Rows in the Angular ...
This post will walk through a setting up a simple data table using material components, the anatomy of the drag-and-drop module, and how...
Read more >Horizontal Scrollbar #455 - swimlane/ngx-datatable - GitHub
App gets loaded with a empty datatable (because the data is loaded from the server). The page is shorter than the browser height....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m back with a 6-month progress report: zero 😅 And since nobody else reacted to this, we’ve decided not to add this by default - no point. If someone wants it, they should be able to do it by adding a script, using the script widget. It’s not great… but it’s possible… 🤷♂️
I have good news for you @er2es . You can already do that, using
$this->crud->disableResponsiveTable()
. Check out the brief docs here - https://backpackforlaravel.com/docs/4.1/crud-api#responsive-tableCheers!