Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible to use window as the scroll element #73

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rjohnson06
Copy link

@rjohnson06 rjohnson06 commented Jul 22, 2016

I made getting and setting of the scroll position configurable. This makes it possible to use the window as the scroll element. Using JQuery for setting/getting window scroll position in the below example.

  var clusterizeOptions = {
            contentId: 'content-area',
            rows_in_block: 50,
            tag: 'tr',
            callbacks: {
                clusterChanged: function () {
                    Seatics.config.ticketRowRenderedHandler();
                    $("#tickets-table [data-toggle=tooltip]").tooltip();
                }
            },
            show_no_data_row: false
        };
            clusterizeOptions.scroll_top_getter = function () {
                return $(window).scrollTop();
            };
            clusterizeOptions.scroll_top_setter = function (amt) {
                $(window).scrollTop(amt);
            };
            clusterizeOptions.scrollElem = window;
        var clusterize = new Clusterize(clusterizeOptions);```

@kamaladenalhomsi
Copy link

Hi

Why this PR is not merged yet?

@hcarneiro
Copy link

hcarneiro commented Jan 21, 2021

I found that using this solutions creates a visual hiccup when the clusters change.
See video that shows what I mean. https://www.loom.com/share/c37e7b145c264c6f8f4df7afcb7be8ea

UPDATE: This happens because the scroll area doesn't have a max-height, as soon as I set one all works well again.

@JosephMawer
Copy link

JosephMawer commented Aug 25, 2022

I'm unable to get this example to work, is there a full example somewhere of using the windows scroll bar? or could someone please elaborate on what is required? I have implemented the changes from this PR locally and used the example above but it seems my 'clusterChanged' function is not being called and only able to see first 200 rows.

UPDATE: I actually got it working, the issue was I had css: body { overflow: auto; } once I removed that it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants