Hello,
It is possible to instantiate a timeline with a json data from a remote source?
For example, I have the following request:
$.ajax({
type: 'GET',
url: "/getData",
contentType: "application/json; charset=utf-8",
success: function (data) {
instantiateTimeline(data);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("Error: " + errorThrown);
}
});
My data is a Json array object with a key element 'start' and a key element 'content' and in case of success I use the data as source for the timeline.
timeline = new links.Timeline(document.getElementById('timeLine'));
function onRangeChanged(properties) {
document.getElementById('info').innerHTML += 'rangechanged ' +
properties.start + ' - ' + properties.end + '<br>';
}
// attach an event listener using the links events handler
links.events.addListener(timeline, 'rangechanged', onRangeChanged);
// Draw our timeline with the created data and options
timeline.draw(data, options);
Sorry for my English.