Agenda view does not trigger events

In the agenda view, it is impossible to trigger events: click, dblclick, etc.

I have tried creating javascript that has .dhx_agenda_line’s click trigger .dhx_cal_data’s click event - but it never gets back to the scheduler’s event handler. :frowning:

What’s the workaround? I noticed that in the agenda week view it is not a problem, but there is a lot of complex javascript and I didn’t dig deeply enough to see what the difference is.

Do you mean clicking on free space of agenda view? Because event handlers definitely works for the event bars in the agenda view.

Clicking on empty space currently doesn’t produce events in many view ( we are thinking about fixing this situation ), you can locate the next line in scheduler.js

if ((id && !scheduler.callEvent(“onClick”,[id,e])) ||scheduler.config.readonly) return;

and change it as

if ((!scheduler.callEvent(“onClick”,[id,e])) ||scheduler.config.readonly) return;

It will enable onClick handler for all clicks

Thanks. That helps a little. What I really want to do is match the behavior I have on other views:

  1. Dblclick handler when clicking on event text
  2. Use scheduler.templates.event_class in order to color-code events.
  3. Override what is displayed in agenda view using the templates extension, or some other way.

Basically, I’d like the agenda view to support all the same features that other views have for consistency of the user experience. I found that tooltips do work correctly. The items above are what remains.

Kate

dblclick - confirmed and will be fixed in the next version ( file in the attached sample already contains the fix )
class and text already can be customized through templates - check the attached sample.
scheduler_agenda.zip (52.6 KB)

Thanks! I appreciate the help.

I found that the agenda script included fixed the template & event_class functions (those failed to work out of the box.)

And the dhtmlxscheduler script did indeed fix the dblclick issue!

I discovered that the fix provided here doesn’t fix the issue if a class name is used for display of agenda text:

  scheduler.templates.agenda_text = function(s,e,t){
     return '<div class="foo">' + t.text + '</div>';
  }  //dbl-click does not work

 
  scheduler.templates.agenda_text = function(s,e,t){
     return '<div class="">' + t.text + '</div>';  //empty class or no class
  }  //dbl-click works!

Problem confirmed, fix will be provided as part of oncoming update.
Please send PM if you need it ASAP ( I will send beta version when it will be available )

Working on some kind of a workaround right now - turned out to be a release showstopper. :slight_smile: Will post if it works.

I appreciate the speed of your guys’ response. Hope that you find my efforts helpful!

Hello,

You can update scheduler._on_dbl_click function in dthmlxscheduler.js, it should fix the problem:

scheduler._on_dbl_click=function(e,src){ src = src||(e.target||e.srcElement); if (this.config.readonly) return; var name = src.className.split(" ")[0]; switch(name){ case "dhx_scale_holder": case "dhx_scale_holder_now": case "dhx_month_body": case "dhx_wa_day_data": if (!scheduler.config.dblclick_create) break; this.addEventNow(this.getActionData(e).date,null,e); break; case "dhx_body": case "dhx_wa_ev_body": case "dhx_agenda_line": case "dhx_cal_event_line": case "dhx_cal_event_clear": var id = this._locate_event(src); if (!this.callEvent("onDblClick",[id,e])) return; if (this.config.details_on_dblclick || this._table_view || !this.getEvent(id)._timed) this.showLightbox(id); else this.edit(id); break; default: var t = this["dblclick_"+name]; if (t) { t.call(this,e); } else { if (src.parentNode) return scheduler._on_dbl_click(e,src.parentNode); } break; } };
Kind regards,
Ilya

I have been using the fix provided in the beginning of this message - and found that it has a bug.

You will see it here: leadscon.connectfu.com:42001/sch … _form.html

When creating an event via a double-click, end date is messed up (IE) - NaNaNa. The original scheduler does not have that problem.

The “fixed” scheduler is here: leadscon.connectfu.com/scheduler … r_fixed.js

I am pretty sure it’s the one attached to the earlier thread in this message. Can you please fix it? :slight_smile:

This matter was resolved directly.

For everyone: Updated version of dhtmlxscheduler.js includes all latest changes so don’t use one posted above.

Kind regards,
Ilya