CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Scheduler options and other questions

by Jorge Sousa » 17 Jan 2014 15:52

Hello

OnAdd, is provided by the plugin, but to be used at a diferent level, and replace the default behaviour.

I presume you need an event, before the item get's added, is that it?

Here is how we add an item.

Code: Select all
function TIWCGJQCustomScheduler.AddHandler(AParams: TStrings; ASObj: ISuperObject): ISuperObject;
var
  Event: TIWCGJQSchedulerEvent;
begin
  Result:= nil;

  Event:= JQSchedulerOptions.EventItems.Add;
  // GetNewID event
  Event.ID:= GetNewEventID(Event);

  Result:= SO(Event.ID);

  Event.Subject:= AParams.Values['CalendarTitle'];

  Event.StartTime:= StrToDateTime(AParams.Values['CalendarStartTime'],GetWorkingFormatSettings);

  Event.EndTime:= StrToDateTime(AParams.Values['CalendarEndTime'],GetWorkingFormatSettings);

  Event.AllDay:= AParams.Values['IsAllDayEvent'] <> '0';

  Event.Editable:= True;
end;


With best regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by assapan » 25 Jun 2014 09:44

Hi,
Sorry to dig this topic after so long time , i am back to this application. :mrgreen:

so to summarize , in the onEditEvent ( regardless if the event exist or not ) the parameters sent contains DATA which owns the datetime of the event . but with the onAddEvent i am not able to find the date and time of it.

is there a way to disable the button Create event or a way to disable the "New event" box and jump to the edit directly ?
You do not have the required permissions to view the files attached to this post.
Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by assapan » 26 Jun 2014 17:27

Hi,
I have been working all afternoon to understand my Scheduler problem , there is something i don't understand , this is the javascript code called by the Create event button
Code: Select all
                        var param = [{ "name": "CalendarTitle", value: what },
                           { "name": "CalendarStartTime", value: datestart },
                           { "name": "CalendarEndTime", value: dateend },
                           { "name": "IsAllDayEvent", value: allday },
                           { "name": "timezone", value: zone}];

                        if (option.extParam) {
                           for (var pi = 0; pi < option.extParam.length; pi++) {
                              param[param.length] = option.extParam[pi];
                           }
                        }

                        if (option.quickAddHandler && $.isFunction(option.quickAddHandler)) {
                           option.quickAddHandler.call(this, param);
                           $("#bbit-cal-buddle").dialog("close");


so i suppose that those parameters are sent to the server CalendarTitle,CalendarStartTime,CalendarEndTime etc.. but they are not or i don't know how to get them !!

so i modified the script like this
Code: Select all
                                var param = [0,'',datestart,dateend,allday];

                        if (option.extParam) {
                           for (var pi = 0; pi < option.extParam.length; pi++) {
                              param[param.length] = option.extParam[pi];
                           }
                        }

                        if (option.quickAddHandler && $.isFunction(option.quickAddHandler)) {
                              option.EditCmdhandler.call(this, param);


And it works , i know i am calling the EditCmdHandler instead of the QuickAddHandler.

It seems that i do not understand how the events are called ,
Note

please help me

Want to visit Ardeche http://leclosdelarc.fr/index.php
The Pont d’Arc Cavern http://en.cavernedupontdarc.fr
Image
User avatar
assapan
 
Posts: 600
Joined: 16 Dec 2013 12:04
Location: France

by Alexander Bulei » 26 Jun 2014 17:59

Hi assapan,

I have checked this event, and it should have only one parameter.

Fixed in V2.1.0.3704. Thanks.

P.S: For now, you can use the first parameter.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

Previous

Return to JQScheduler

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.