iPad support again

Hi there -
I’m trying to get regular scheduler working on an iPad. When I include a tooltip for the events, when I tap on the event on a iPad, only the tooltip shows and no lightbox. I looked thru the forum and found a thread where you suggest attachEvent(“onClick”, … etc.
That doesn’t work.
Can you provide a suggestion for an alternate way to do this. I’m sure there are others that would appreciate a solution.
Thanks,
Irv

Hello,

That doesn’t work.
What exactly doesn’t work? The following code will show lightbox when user tap on the event:scheduler.attachEvent("onClick", function(id){ scheduler.showLightbox(id); });

Hi Aliaksandr, thanks for replying -
That`s exactly what I am doing - attachEvent("onClick … etc.
and it doesn’t work (lightbox doesn’t open) when I tap on an event on an iPad. Only the tooltip shows and no lightbox opens. If I remove the tooltip option (dhtmlxscheduler_tooltip.js), then it does work (lightbox opens)when I tap on an iPad.
I guess that a tap on an event in the iPad environment doesn’t trigger an onClick event.
Can you suggest an alternate possibility for the iPad situation.
BTW - it works in the Android environment.
Thanks,
Irv

We will add logic which will disable tooltips automatically and show lightbox instead in the next version of the scheduler.

There must be a simple work around that would solve that for now. For example, if there is a view change detected, then the lightbox can be forced to close - or something like that. Or redraw the view change if it goes to the day view (assuming that the lightbox would close due to the redraw of the view).
I realize that these are not the most elegant solutions, but at least they’d provide what I need until the new version is available.
Any help would be appreciated.
Thanks,
Irv

Sorry - I mixed this thread up with another one that I have going on the active_links going from month to day. So ignore that reply.
Still, there must be some way to modify something to resolve the ipad tap situation. I’m a noob on all this, but you guys are brilliant.
Ideas …?
Irv

So 3 questions on this topic -

  1. when is the new version of the scheduler scheduled for?
  2. Can you point me in the direction or provide an idea of how I might detect the difference between an ios mouseover vs. click, etc so that I might try my hand at modifying the js.
  3. Is there a way I can turn the tooltip on and off using code? If that were possible, I could either tie it into a button that the user would press to enable or disable tooltips (make the button visible only in the ios environment). It’s not as elegant, but why not.
    Thanks in advance,
    Irv
  1. when is the new version of the scheduler scheduled for?
    First part of February
  1. Can you point me in the direction or provide an idea of how I might detect the difference >>between an ios mouseover vs. click, etc so that I might try my hand at modifying the js.

The problem is - there is no difference. When you are making touch on ios - ios checks is the element under cursor has mouseover handler , and if it has then it fire mouseover event, else onclick event. Second touch after mouserover will always trigger onclick event.

Original code in tooltip.js uses something like

scheduler.attachEvent("onMouseMove", function(event_id, e) {

You can add as first line of that code block, check of navigator.userAgent string, and if it contains “Mobile” prevent further code execution;

Is there a way I can turn the tooltip on and off using code?
There is no flag, but you can use

dhtmlXTooltip.config.timeout_to_display = 606024*1000;

to disable tooltip, or set it back to 50 to return normal functionality

Thank you very much for the info -
I played around with things a bit and to re-cap -
I’m currently am doing something like the following for my tooltip text -
scheduler.templates.tooltip_text = function(start,end,event){
return scheduler.templates.event_date(start)+"-"+scheduler.templates.event_date(end)+"
… etc,
};

As mentioned, I’m also doing attachEvent(“onClick”, … etc.

When both of those are present in the ipad environment and you tap the event, the onClick function doesn’t happen. On an android device, a tap results in both the tooltip AND onClick happening. On a PC and MAC, it works as it should.
But I noticed that if I return false in the
scheduler.templates.tooltip_text = function(start,end,event) { return false; }
then in the iPad environment, it will then do the onclick (but or course, there’s no tootip text).

So what I’ve done is - based on the environment (ipad, iphone, android, etc. using navigator.userAgent …), in my scheduler.templates.tooltip_text = function(start,end,event),
I either return false or the actual tooltip string.

That seems to work fine. So my question is - does that make sense to you as a solution or will it result in some other problem that I don’t immediately see? As I said, it seems to work.

If that makes sense, I’m going to include a checkbox that appears only in the ios environment that allows the user to choose between tooltip or onclick.

Thanks,
Irv

It is correct use-case.
Scheduler has logic, if template returns empty ( or false as in your case ) value - tooltip will not be shown, so this is one of legal ways to block tooltip functionality.