question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Horizontally dragabble datatable

See original GitHub issue

Feature 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:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tabacitucommented, Jul 11, 2022

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… 🤷‍♂️

1reaction
tabacitucommented, Dec 19, 2021

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-table

Cheers!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found