integrating dhtmlx form with scheduler

I’m using a custom lightbox made from a popup dhtmlx window with a form attached and I need some help figuring out how to integrate my form with the scheduler. Right now, I have

scheduler.attachEvent("onEmptyClick", function(){ scheduler.showLightbox();});
This shows my popup form alright, but also shows the default event creation – but the two aren’t linked in anyway. Is there anyway to connect them?

Also, when I try to close the window, I get two errors from dhtmlxwindows.js:
“w is undefined” (line 477), and “win is undefined” (line 2168).

Any help is appreciated.

For form integration - the best way will be to redefine showLightbox as

scheduler.showLightbox = function(){ ...your custom form code here ... };

In such case, each time when scheduler will try to show the details form - it will show your custom form, instead of the original one.

As for js errors - please provide demo link or any kind of sample where it can be checked.

Stanislav,

Thanks for getting back to me. I’ve attached a demo with everything except the dhtmlx files. I’m using dhtmlxSuite 2012 Rel.1 (DHTMLX 3.5) Professional edition build 120822 and dhtmlxScheduler PRO v.3.7 build 130220.

I only get the errors if the form was opened by clicking on the scheduler – when I use the toolbar button to open it, it works fine.

Thanks for your help.
demo.zip (5.23 KB)

(a)

You may need to have the next line

scheduler.config.details_on_create = true;

It will replace inline editor with lightbox

(b)

Change code of form closing as

scheduler.endLightbox(false,form2a.cont);

Second parameter must be an html container

I’m still having trouble with this. Since the form is attached to a dhtmlx container component, it doesn’t really have an html container, so I’m not sure what to reference in that code snippet. Also, I’m getting the error when I try to use the close button that’s built in to the window. The form buttons are not producing an error – they’re just not working.

. Since the form is attached to a dhtmlx container component, it doesn’t really have an html container

You always can use

scheduler.endLightbox(false, null);

Check the updated code (attached)

  • startLightbox | endLightbox added
  • code of onEmptyClick changed
    dejaOffice.zip (1.71 KB)

Stanislav,

I’ve implemented the code you attached, but now none of the form controls are working. When the form is opened, either through the toolbar button or by clicking the scheduler, the whole page freezes up :cry:
dhxLayout.dhxWins.window(“addEvent”).hide(); doesn’t seem to work at all, nor does form.clear();. And, of course, no events are added.
The close button at the top of the window works, but the page stays frozen.

On a possibly related note, is there a way to bind a form to the scheduler the way you can with grids?

Thanks for you help.

The above attached sample contains all necessary modifications, and works correctly ( there is no effects which you are describing ) Have you used the same code or some different one ? In case of different code can you provide a demo link or a sample where it can be checked ?

is there a way to bind a form to the scheduler the way you can with grids?
Unfortuantely it is not possible