[Simile-Widgets] update highlight dynamically

2011-10-27 Thread Alvin
Hello, I am wondering if there is a way to update the highlighted parts of the timeline dynamically (i.e., update the decorators)? I got it to work by re-creating the entire timeline but that unfortunately will also recenter the timeline. Thanks. -- You received this message because you are

Re: [Simile-Widgets] update highlight dynamically

2011-10-27 Thread Michael Nosal
Yes, this is possible, and quite easy to do. You do need to add a method to set the times for your decorator and call .paint() on the decorator: Timeline.SpanHighlightDecorator.prototype.setEndDate = function(date) { this._endDate = date; };

Re: [Simile-Widgets] update highlight dynamically

2011-10-27 Thread Alvin Cheung
I see. Thanks. Then is it possible to dynamically add decorators? Alvin On 10/27/2011 12:16 PM, Michael Nosal wrote: Yes, this is possible, and quite easy to do. You do need to add a method to set the times for your decorator and call .paint() on the decorator:

Re: [Simile-Widgets] update highlight dynamically

2011-10-27 Thread Michael Nosal
Add this function: Timeline._Band.prototype.addDecorator = function(decorator) { this._decorators.push(decorator); decorator.initialize(this,this._timeline); decorator.paint(); } then you can do: var band = tl.getBand(0); band.addDecorator(new