setLoadMode fails to load anything

Hi guys, im struggling to configure dhtmlxScheduler and would appreciate any pointers on where I’m going wrong.

I have set the Scheduler up with minimal options with dates saved in a database in the default date format eg.(07/20/2010 01:15). Everything works fine, all events are loaded fine until I enable setLoadMode(‘month’) and then none load.

The documentation says

Which I read as “i dont have to do anything server side, it will just work”.

My code

[code]scheduler.init(‘scheduler_here’,null,“week”);
scheduler.setLoadMode(“month”);
scheduler.config.show_loading=true;
scheduler.load(“sections/scheduler/load.ajax.php?uid=”+scheduler.uid());

var dp = new dataProcessor(“sections/scheduler/load.ajax.php”);
dp.init(scheduler);[/code]

Any ideas?

Thank you.

Which I read as “i dont have to do anything server side, it will just work”
Yep, if you are using connectors on server side - it must work without extra configuration.

Which DB type you are using on server side?
Be sure that start_date and end_date fields in DB have datetime type.

Ah ok, i see, the database must store the dates in datetime otherwise working out the range from a string would be complex (I should have realised this).

Ok with that now known I have gone back to my original plan of storing the dates as Unix timestamps (using an existing table of events) and converting the dates back and forth and Im happy to say dynamic loading is working perfectly converting FROM and TO into timestamps too.

Thanks for clearing that up, Stanislav :slight_smile:

Rather than start a new topic I thought I’d save space and tack this little question on here.

When creating a new event I want the lightboxes “User” dropdown to be set to the current logged in user but I cant find anything in the documentation that specifically targets lightbox form elements.

So i tried :

scheduler.attachEvent("onEventCreated", function(event_id,event_object){ $(".dhx_cal_lsection:contains('User')").remove(); console.log(event_id); return true; });
.remove() is only for testing purposes to ensure jquery could access the lightbox in the DOM. It does, however the “User” line (the header above the select dropdown) only disappears on the SECOND event creation. I assume because the lightbox isn’t created until after the “onEventCreated” event. “onBeforeEventChanged” yields the same result. Im at a loss.

Any ideas? or alternative ways to achieve this?

Thank you!

So you need not “user” field in lightbox at all?
Or need to show it only for edit operations?

in first case, just remove related section from the lightbox configuration , you can set property directly to event object, without declaring them in lightbox

in second case - check
docs.dhtmlx.com/doku.php?id=dhtm … ome_events

only disappears on the SECOND event creation
during first call, form is not rendered yet.

Ok, I thought that was what was happening. Any way to force the form to render before it is required? Or am I missing an event that I can use to slide this code in AFTER it renders but BEFORE the user does anything with it?

I do need the select box for the user. Basically I need to a dropdown of all the users in the system, when the logged in user creates a new event it will by default set them as the user for the event… but they also need to be able to assign the event to another user if needed.

Scouring the documentation again, I think I need to create a custom editor for the lightbox. Hmm…

slide this code in AFTER it renders but BEFORE the user does anything with it?
onLightbox