I have a tooltip string builder line like this:
scheduler.templates.tooltip_text = function(start,end,event)
{
return "<strong style=\"font-size:16px;\"><a href=\"https://www.somewebsitethatshowsmoredetails.com/details:"+event.IMO+"/something:"+event.text+"\" target=\"_blank\">"+event.text+"</a></strong>"+" "+event.BubbleCode+
"<ul><li><strong>.....and other html injection here"
};
The tooltip, shows a URL link and some data fed from the 'event' object.
One of those details is 'event.BubbleCode', which has one value at any one time, a numeric 0, 1, 2 or 3.
Is there a way to place an switch() statement or some logic within the string line above to turn that BubbleCode value into a colored character such as an asterisk?
Something like this...BUT for the '3' to be a GREEN asterisk, or if it's a value of '2' for it to be a RED asterisk.
You could use a span and set its color. If your "switch" should be inline just use an object and access it at event.BubbleCode.
It could look like this:
scheduler.templates.tooltip_text = function(start,end,event)
{
return "<strong style=\"font-size:16px;\"><a href=\"https://www.somewebsitethatshowsmoredetails.com/details:"+event.IMO+"/something:"+event.text+"\" target=\"_blank\">"+event.text+"</a></strong><span style=\"color:" + {0:'black',1:'yellow',2:'red',3:'green'}[event.BubbleCode] + ";\">*</span>"+
"<ul><li><strong>.....and other html injection here"
};