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

Remote events data #95

Open
DeltaServiceSoftware opened this issue Nov 3, 2023 · 2 comments
Open

Remote events data #95

DeltaServiceSoftware opened this issue Nov 3, 2023 · 2 comments

Comments

@DeltaServiceSoftware
Copy link

DeltaServiceSoftware commented Nov 3, 2023

Hi,
Is it possible to receive event data, in json format, from a remote resource?
Thanks for help.

@ka215
Copy link
Owner

ka215 commented Nov 5, 2023

Yes, you can do this by generating or updating the timeline after fetching the remote JSON data.
Example of generating a timeline after fetching JSON data:

fetch("/path/to/getJsonEvents").then(response => {
  if (response.ok) {
    const events = response.json();
    $('#my-timeline').Timeline({ eventData: events });
  }
});

Or, example of obtaining and adding JSON data for an event to an already generated timeline:

$('#my-timeline').Timeline();

fetch("/path/to/getJsonEvents").then(response => {
  if (response.ok) {
    const events = response.json();
    $('#my-timeline').Timeline('addEvent', events);
  }
});

Best to try.

@DeltaServiceSoftware
Copy link
Author

Timeline

It works! Thanks so much

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

2 participants