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

Event handling in case of multiple timelines #61

Open
adnia opened this issue Nov 25, 2016 · 0 comments
Open

Event handling in case of multiple timelines #61

adnia opened this issue Nov 25, 2016 · 0 comments

Comments

@adnia
Copy link

adnia commented Nov 25, 2016

Hi,

I have a scenario where I read and create multiple timelines, one respectively for different persons.

I register an "select" event handler to each timeline; this event handler shall unveil a description associated with each item (to provide more details on demand).

However, although I register the event handler function with each timeline I create, it only works for the last timeline created. In the other timelines, I can select items as well, but the event handler is not executed at all.

This is the code I use to register the event handler:

    var timelines;

    function loadTimeline(member, items, groups, options) {
        // Define and create child div of "timelines" to load timeline in
        // [...]
        var container = document.getElementById(member["id"]);

        var timeline = new vis.Timeline(container, items, options);
        timeline.setGroups(groups);

        timeline.on("select", selectEvent);
        timelines.push(timeline);
    }
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

No branches or pull requests

1 participant