I was having the same problem as you, and it took me some time to find
the solution, and actually the solution was already in the example
that demonstrates the use of autoWidth:
http://simile-widgets.googlecode.com/svn/timeline/tags/latest/src/webapp/examples/test_example2/test_example2.html
(I just managed to look over it, again and again)
tl.loadJSON("/timeline/events", function(json, url) {
eventSource.loadJSON(json, url);
tl.finishedEventLoading(); //By adding this line, the Timeline
automatically chooses the correct height.
});
It was a bit confusing I guess, I never found anything in the
documentation that this line was needed in order to make autoWidth
work.
Your solution didn't work the first time the Timeline loaded, because
then it took some time to load the JSON data. From the moment the JSON
data had loaded once, your solution did work, but yet it's not
recommended I think.
I was having the same problem as you, and it took me some time to find
the solution, but actually the solution was already present in the
example demonstrating the use of autoWidth:
http://simile-widgets.googlecode.com/svn/timeline/tags/latest/src/webapp/examples/test_example2/test_example2.html
(I just managed to look over it, again and again).
tl.loadJSON("/timeline/events", function(json, url) {
eventSource.loadJSON(json, url);
tl.finishedEventLoading(); //This line makes the Timeline choose the
correct height automatically
});
I find it strange that the documentation didn't seem to mention that
this line is needed in order to make autoWidth work correctly.
Your solution didn't work for me the first time my Timeline
loaded,because then it took some time to load the JSON data. From the
moment the JSON data had loaded once, your solution did work, but it's
probably not recommended and you should better use
tl.finishedEventLoading();