Hi,

OK, It's working now, it seams that the problem was the data type of of the 
parameters of the array used to create the events' objects (Empty parameters 
should be set to null not "").

I saw in the archives that other people where interested in manually adding 
events to a timeline so here is the working code:

var EventsArray = new Array(
     new Timeline.DefaultEventSource.Event(
          new Date(),
          null,
          null,
          null,
          "false",
          "Event title",
          "Event Description",
          null,
          null,
          null,
          null,
          null
     )
);
myTimeLine.getBand(0).getEventSource().addMany(EventsArray);

Thanks

Erez





----- Original Message ----
From: Erez Boym <[EMAIL PROTECTED]>
To: [email protected]
Sent: Wednesday, March 5, 2008 2:41:40 PM
Subject: Creating TimeLine events from an external function


Hi,

I'm 
trying 
to 
create 
events 
from 
an 
external 
function. 
I 
have 
an 
input 
source 
which 
is 
not 
natively 
supported 
by 
TimeLine 
and 
I 
need 
to 
manually 
add 
events 
to 
the 
TimeLine.

I 
have 
tried 
to 
mimic 
the 
procedure 
in 
the 
XML 
input 
source:

 
var 
evt 
= 
new 
myTimeLine.DefaultEventSource.Event(
  
  
 
parseDateTimeFunction("Feb 
09 
2008 
19:50:00 
GMT"),
  
  
 
parseDateTimeFunction("Feb 
11 
2008 
17:20:00 
GMT"),
  
  
 
parseDateTimeFunction(null),
  
  
 
parseDateTimeFunction(null),
  
  
 
"true",
  
  
 
"Event 
title",
  
  
 
"Event 
Description",
  
  
 
null,
  
  
 
null,
  
  
 
null,
  
  
 
null,
  
  
 
null
);
myTimeLine._events.add(evt);

And 
the 
examples 
I 
had 
found 
on 
the 
archives:
myTimeLine.getBand(0).eventSource.loadJSON({
  
  
 
'events' 
: 
[
  
  
  
  
  
{
  
  
  
  
  
  
  
 
'start' 
: 
$json_encode("Feb 
09 
2008 
19:50:00 
GMT"),
  
  
  
  
  
  
  
 
'end' 
: 
$json_encode("Feb 
11 
2008 
17:20:00 
GMT"),
  
  
  
  
  
  
  
 
'title' 
: 
$json_encode("Title"),
  
  
  
  
  
  
  
 
'link' 
: 
$json_encode(""),
  
  
  
  
  
  
  
 
'description' 
: 
$json_encode("Description"),
  
  
  
  
  
},
  
  
 
],
  
  
 
'dateTimeFormat': 
'iso8601'
  
  
 
}, 
"http://$PAGE_USERID.$IHOST";
);

but 
all 
I 
getting 
is 
an 
err 
saying: 
TypeError: 
Undefined 
value

What 
will 
be 
a 
correct 
syntax 
to 
add 
en 
event 
using 
an 
external 
function 
(A 
non 
JSON 
syntax 
is 
preferable) 
?

Thanks

Erez





  
  
  
____________________________________________________________________________________
Looking 
for 
last 
minute 
shopping 
deals?  
Find 
them 
fast 
with 
Yahoo! 
Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_______________________________________________
General 
mailing 
list
[email protected]
http://simile.mit.edu/mailman/listinfo/general





      
____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to