Marcelo Agimóvel
Marcelo Agimóvel

Reputation: 1719

Jquery Datatable: here we go again with horizontal scroll like Excell

The goal

Create an easier way to scroll Jquery Datatable (horizontally)

The problem:

Double scroll sucks, because it doesn't work properly, sometimes top scroll doesn't scroll datatable until the end, but bottom scroll works fine.

Another think that I tried without success: on mobile, you can scroll with swipe. Would be awesome do that on desktop by holding click.

How can we achieve this:

1- Scroll horizontally by holding left click and moving right/left;

2- Remove Datatable scrolls and have only one fixed "scroll" that whould command jquery datatable horizontal scroll;

3- Or maybe the datatable bottom scroll be fixed at page bottom?

Upvotes: 1

Views: 413

Answers (1)

Marcelo Agimóvel
Marcelo Agimóvel

Reputation: 1719

I found a solution:

First, let's add this options on datatable:

"scrollY":        screen.height / 2,
"scrollCollapse": true,

This will make sure datatable dont strech vertically when there's too many rows and will show scroll.

Now I just have to make sure this height let the horizontal bar always showing, now that contents get scrolled inside datatable.

Upvotes: 1

Related Questions