Questions about creating events

Hello,

As you know I have been working on integrating DHTMLX scheduler to replace our old jquery calendar.

One of my last hurdles is the creation of events through the calendar. I have been unsuccessful in saving any events created to the server. Here is a snippet of my code

[code] scheduler.config.lightbox.sections=[
{name:“description”, height:130, map_to:“text”, type:“textarea” , focus:true},
{name:“custom”, height:23, type:“timeline”, options:null , map_to:“section_id” }, //type should be the same as name of the tab
{name:“time”, height:72, type:“time”, map_to:“auto”}
]

	scheduler.init('scheduler_here',null,"month>");
	scheduler.load(["/calendar/get_data_1", "/calendar/get_data_2", "/calendar/get_data_3"]);

//does nothing…
var dp = new dataProcessor("/calendar/send_data");[/code]
Firstly, how can I send data to the server. From reading through the documentation is seems to be through dataProcessor. However I have had no luck. When I monitor the log through dp.init(scheduler); I see the following:

however I don’t know how to handle the incoming data as I cannot see anything happening through my firebug console.

Secondly, when creating the booking all of my “sections” are in the same drop down menu, even though they have come from 3 separate sources. As you can see I am loading from multiple sources, each of which source is coming from a different database. How can I direct Scheduler to create 3 different drop-downs that will then update only the relevant databases.

Our old calendar simply had a menu (asking what type of event should be booked) popup when a day was clicked in the month or week view. This then took the user to the relevant booking page with the correct date prefilled. Not great, but it worked. At the very least I would like to get this functionality working.

I hope you will be able to help me through this.

Thanks,
Tim

You can create a select in the lightbox form, with possible types
And on server side code , attach custom logic to beforeProcessing event, and based on init trigger custom saving logic for different types of events

however I don’t know how to handle the incoming data
as I cannot see anything happening through my firebug console.
Do you mean that scheduler doesn’t generate saving ajax call?

No, nothing is appearing when the event is saved. I only see ajax calls for when data is being loaded from my sources.

It seems that you are using dhtmlxscheduler_debug.js
Try to switch to the standard dhtmlxscheduler.js
There is a known issue, that debug version can have problems with ajax data sendind in some cases.

Hello,

I have now switched to the standard JS file however the problem remains. No ajax calls are being made when the event is created.

I know I am monitoring it correctly as I can see the calendar retrieving data.

Any other ideas?

Thanks,

Tim

Hello, Tim.

Make sure you have dp.init line:

var dp = new dataProcessor("php/events_rec.php"); dp.init(scheduler);
Best regards,
Ilya

Thanks!

That was it.

Following on from my other question http://forum.dhtmlx.com/viewtopic.php?f=6&t=17961 I need to implement a seperate server side logic.

My first problem:

When I look at the $_POST data that is being sent by Scheduler it looks like this:

1301452809916_!nativeedit... inserted 1301452809916_end_date 2011-03-31 08:10 1301452809916_id 1301452809916 1301452809916_section_id F1 1301452809916_start_date 2011-03-31 08:05 1301452809916_text New event ids 1301452809916
How can I access the data with PHP without already knowing the ID of the new event?

Thanks,

Tim

Hello, Tim.

As you showed it yourself :wink: :

ids   1301452809916

So ids is the list of ids (comma separated) in the current post request.
After that it’s $id_[name of the property].

Best regards,
Ilya

Doh!! I missed that completely… :blush:

Ok I’ll give it a go.

Thanks,

Tim

Hello,

I have another problem:

I am getting a “Disallowed Key Characters.” response to any ajax send request from Scheduler.

I have tracked this down to be a Codeigniter issue, however is caused by certain characters in the POST keys.

Here is a POST detailing the issue: http://tiffanybbrown.com/2010/07/21/codeigniters-disallowed-key-characters-error-revisited/

Do you have any advice (perhaps a line number of the generation of the POST array) on how I can alter the POST array to not have these characters?

Thanks again for all your help,

Tim

Hello,

I fixed this by removing the ! from !nativeedit in the .js file.

Thanks,

Tim