Hello
I am trying to set a template for the timeline_scale_label but i don’t understand how it works.
First of all, even by looking in the documentation, I was not sure of what function I should have defined. By looking in the dhtmlxscheduler_timeline.js I found out that it was a function (p,r,q) (3 arguments) that should be defined.
So I set my function as the following :
scheduler.templates.timeline_scale_label = function(Q,R,P) {
return "test : "+R;
}
But it doesn’t go in the function (I put a breakpoint using IE)
I am using a timeline, and I would like to modify the content of the label (Y column) in order to add HTML code to show an image within the label column next to the label that is currently displayed.
I am not sure that it is possible, but as I doesn’t even suceed in the fact to access to the templates
Have somebody some hints to help me ?
Thanks in advance !
Thank you for your question. It seems this information is missing in the documentation, we will add it the nearest future.
Template may look like this:
scheduler.templates.timeline_scale_label = function(key, label, timeline_config) {
return label+" (id: "+key+");
};
Where timeline — is the name of your timeline view, e.g.:
scheduler.createTimelineView({
name: "timeline",
...
Add this template somewhere before scheduler’s init. In case it won’t work - what version of scheduler are you using?
Hope this helps.
There is an other part of the code where I call again scheduler.createTimelineView. The first call is only to initialize the timeline view, the further call are to load the timeline with the proper ressource.
Here is the function that create the timeline with ressources :
When timeline view is initialized it creates all necessary templates for itself with some default values. That is why after you create timeline view the second time previous template function doesn’t seem to work (it was reassigned).