Giter Club home page Giter Club logo

Comments (7)

josdejong avatar josdejong commented on September 9, 2024

The Timeline of the successor of chap-links-library, vis.js, has eventlisteners like click and doubleClick which you can use.

About refreshing data: without a code example of what you're doing there isn't much I can say about that. When loading new data you have to apply it using Timeline.setData(), do you do that?

from chap-links-library.

meydey232 avatar meydey232 commented on September 9, 2024

I have working action and modal form but I need to pass the datas from the clicked cluster - I mean if I have few groups and I click on 9 July in group "abcd" i need to pass the start date and name of group into this modal form.
Ohh, thanks. I didn't check with setData() - maybe it will help, let you know.

from chap-links-library.

josdejong avatar josdejong commented on September 9, 2024

I mean if I have few groups and I click on 9 July in group "abcd" i need to pass the start date and name of group into this modal form.

There is no built-in way to get this information, you will have to hack something for this into the Timeline yourself. The event listeners of vis.js do provide this information, however, the Timeline of vis.js doesn't yet have support for clustering.

from chap-links-library.

meydey232 avatar meydey232 commented on September 9, 2024

I did it this way:
First we need this function:

function getSelectedRow() {
    var row = undefined;
    var sel = timeline.getSelection();
    if (sel.length) {
        if (sel[0].row != undefined) {
            row = sel[0].row;
        }
    }
    return row;
}

Now everything what we have to do is add a variable into our listener function (it's running on double click):

var onadd = function () {
        var test = timeline.getItem(getSelectedRow());
        $('#form').modal('show');
    };

links.events.addListener(timeline, 'add', onadd);

from chap-links-library.

josdejong avatar josdejong commented on September 9, 2024

What do you mean? Do you mean you solved it like this?

from chap-links-library.

meydey232 avatar meydey232 commented on September 9, 2024

Yep, It is working fine.
Variable test return an object like this:
content: "New"
group: "abcd"
start: Date {Thu Jul 16 2015 22:21:52 GMT+0200}
type: "box"

from chap-links-library.

josdejong avatar josdejong commented on September 9, 2024

Ah now I get what you mean. Ok great you solved it, I will close the issue then.

from chap-links-library.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.