I’m using the timeline view. To modify an exist event, i need to point the mouse over the event and then click on the modify icon. I can i modify the event just double cliking on it?
Thanks
Hello,
Either we are talking about different things or I don’t quite get what is ‘modify icon’. By default to edit event on timeline view you need to double click it.
Please check scheduler/samples/06_timeline/02_lines.html sample.
Best regards,
Ilya
we can’t double click on an event when we create a custom timeline
that’s what he wanna say, for a custom timeline (createTimelineView)
How you can see in the screenshot
when i point the mouse over an event, it show another bar with the icon and i need to click it to modify the event.
I’m using a custom Timeline view.
I would like that when i point the mouse over an event i can click to modify it, without other bar showing.
You can also check the sample
samples\06_timeline\01_slots
to verify
Hello,
Actually timeline could be rendered differently depending on the ‘render’ property. By default it’s ‘matrix’ (01_slots.html sample) but also you can use ‘bar’ (02_lines.html) and ‘tree’ (03_tree.html). Each has it’s own form of data representation and handling.
That’s correct for the timeline-matrix view. As you can have several events in the same cell tooltip with all of them is displayed and you can select required event to edit it.
You can switch to timeline-bar mode or (if you are sure that you will have just 1 event in each cell) add your own handler for onCellClick event.
Best regards,
Ilya
I need the cell mode and it’s possible that will be more than one event for each cell, so how i need to modify it? how i can catch the mouse position on click?
Hello,
You can edit
scheduler.templates.{timeline}_tooltip
template.
For example:
scheduler.templates.matrix_tooltip = function(start,end,event){
return "<span onclick='scheduler.showLightbox("+event.id+")'>"+event.text+"</span>";
};
Now lightbox will be displayed if you click on event.
Best regards,
Ilya
i’m sorry, but nothing change…
Hello,
I am sorry I forgot to mention that my code need to be added below function call which create timeline view itself (createTimelineView). After that you will be able to click on the event name in the tooltip and lightbox will be displayed.
Best regards,
Ilya
Ok, but i would like to click directly the event name, i don’t want to click on tooltip…
Hello,
Before you’ve attached screenshot, with that change you can directly click on the ‘dsad’ event name to open it’s lightbox.
If that is not what you wanted then please describe it in details.
Best regards,
Ilya
So, related to my screenshot, with the code you suggested, now i can click on the name inside the tooltip and open the lightbox.
But, i would like to know if is possible to click directly in the cell, in the image the number “1”, and change the related event.
Actually inside the cell i haven’t the number but the event, so i would like to click on it. It’s the same behaviour of the bar mode; in this case i have the yellow bar with the event inside and to modify it i need just to click on the name event not in the tooltip.
Sure, but you need to handle somehow situation in case there are several events in the same cell.
Logic would be the same, you need to edit your template and add there:
return "<span onclick='scheduler.showLightbox("+event.id+")'>"+event.text+"</span>";
Here we are wrapping event.text with span with attached onclick behavior (displayed lightbox).
Best regards,
Ilya
I don’t understand, sorry…Can you explain?