Yes, adding events is separate from redrawing the timeline.
If you look at sources.js, the last thing the loadXML and loadJSON functions do
is:
if (added) {
this._fire("onAddMany", []);
}
You can manipulate events (adding, editing and removing) in an EventSource and
then trigger the onAddMany event to let the timeline know it should do a
re-layout and a repaint.
--Mike
On Nov 1, 2011, at 8:51 AM, Alvin Cheung wrote:
> Hello,
>
> Apologies if this question is too simple. I'm trying to write code that
> dynamically add events to an existing timeline via ajax with this jquery
> snippet:
>
> newData = jQuery.parseJSON(data);
> for (var i=0; i < newData.events.length; i++){
> var event = newData.events[i];
> var evt = new Timeline.DefaultEventSource.Event(event);
> eventSource.add(evt);
> }
>
> But the timeline doesn't get redrawn after calling eventSource.add. Do I
> need to call something special to get the timeline redraw? I've tried
> printing out the contents of evt and it looks good to me.
>
> Thanks,
> Alvin
>
> --
> You received this message because you are subscribed to the Google Groups
> "SIMILE Widgets" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/simile-widgets?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/simile-widgets?hl=en.