My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Timeline_DataInTheTimelineFile  
Data stored in the Timeline file
Updated Feb 4, 2010 by larryklu...@gmail.com

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.top...@gtempaccount.com, Apr 14, 2009

fvsdfvsd

Comment by schwar...@gmail.com, May 1, 2009

Where is this example 3 you speak of?

Comment by david.le...@gmail.com, May 20, 2009

its in the SVN source

Comment by mega...@hotmail.com, Dec 1, 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>

Comment by somb...@gmail.com, Mar 24, 2010

I'm either looking in the wrong place or this example doesn't exist. Could someone point me to this actual example explicitly please

Comment by scheib@google.com, Mar 30, 2010

The example can be found here: http://code.google.com/p/simile-widgets/source/browse/timeline/trunk/src/webapp/examples/test_example3/test_example3.html

From this Wiki page you can find it by: - Click "Source" tab at top of page - Click "Browse" near top - Navigate code tree: timeline/trunk/src/webapp/examples/test_example3

Comment by bernardo...@gmail.com, Apr 13, 2010

Hi,

the code in example 3 got me confused.

This is not loading an external json file, it's using the json defined there, right? Where do I find an example where an external json file is loaded?


Sign in to add a comment
Powered by Google Project Hosting