diff --git a/docs/timeline/index.html b/docs/timeline/index.html
index f11d1c89..4ca5975e 100644
--- a/docs/timeline/index.html
+++ b/docs/timeline/index.html
@@ -640,7 +640,7 @@ function (option, path) {
groupTemplate |
function |
none |
- A template function used to generate the contents of the groups. The function is called by the Timeline with a groups data as argument, and must return HTML code as result. When the option groupTemplate is specified, the groups do not need to have a field content . See section Templates for a detailed explanation. |
+ A template function used to generate the contents of the groups. The function is called by the Timeline with a groups data as the first argument and the group element as the second, and must return HTML code as result. When the option groupTemplate is specified, the groups do not need to have a field content . See section Templates for a detailed explanation. |
@@ -970,7 +970,7 @@ function (option, path) {
template |
function |
none |
- A template function used to generate the contents of the items. The function is called by the Timeline with an items data as argument, and must return HTML code as result. When the option template is specified, the items do not need to have a field content . See section Templates for a detailed explanation. |
+ A template function used to generate the contents of the items. The function is called by the Timeline with an items data as the first argument and the item element as the second, and must return HTML code as result. When the option template is specified, the items do not need to have a field content . See section Templates for a detailed explanation. |
@@ -1629,6 +1629,17 @@ var template = Handlebars.compile(source);
};
+React templates
+
+You can use a React component for the templates by rendering them to the templates' element directly:
+
+
+ template: function (item, element) {
+ return ReactDOM.render(<b>{item.content}</b>, element);
+ },
+
+
+
Multiple templates
In order to support multiple templates, the template handler can be extended to switch between different templates, depending on a specific item property: