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
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;
};
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:
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