My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 01, 2009 by larrykluger
Timeline_DataInTheTimelineFile  
Data stored in the Timeline file

Introduction

The usual practice is to store your Timeline's data in an external xml or json file. But you can include the data within the body of your Timeline file if you wish.

Details

1. Create a Javascript variable "json" with your JSON Timeline data. Any variable name can be used.

2. After creating your Timeline, load the data: eventSource.loadJSON(json, document.location.href);

3. This technique is demonstrated in Timeline example 3


Comment by igor.to...@muranosoft.com, Apr 14, 2009

fvsdfvsd

Comment by schwartzb, May 01, 2009

Where is this example 3 you speak of?

Comment by david.lee.morrison, May 20, 2009

its in the SVN source

Comment by mega...@hotmail.com, Dec 01, 2009

Just to give those people an impression, who don't want to check out the project from SVN.


<script> ...here some more code....

var event_data =
{ "dateTimeFormat": "iso8601", "events":[
{ "start": "2009-03-10T06:00:00+00:00",
"end": "2009-03-31T22:00:00+00:00",
"instant": false,
"title": "1", "color": "#7FFFD4",
"textColor": "#000000",
"caption": "1",
"trackNum": 1,
"classname": "special_event2 aquamarine",
"description": "bar 1"}
]
};

function onLoad() {

var tl_el = document.getElementById("tl"); var eventSource = new Timeline.DefaultEventSource?(); var theme = Timeline.ClassicTheme?.create();
...here some more code....

eventSource.loadJSON(event_data, document.location.href);

}
...here some more code.... </script>


Sign in to add a comment
Hosted by Google Code