CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Loading Items in JQScheduler

by gamut » 14 Jun 2013 15:01

Hi

How is it possible to load events in a JQScheduler component? I have attempted to view source on your demo for this but nothing displays in the View Source box. Also, this component doesn't seem to be documented in your help page.

I have attempted to add calendar items to the Scheduler using code like the following, but the event does not appear after executing the code. Attempts to reload the grid or call ajaxrender don't seem to make a difference.

procedure TfrmGroupInfo.IWCGJQButton1JQEventsClick(Sender: TObject;
AParams: TStringList);
var
myEvent : TIWCGJQSchedulerEvent;
begin
myEvent := calGroup.JQSchedulerOptions.EventItems.Add;
myEvent.UserData := '12345';
myEvent.AllDay := False;
myEvent.ColorIndex := 4;
myEvent.CrossDay := False;
myEvent.Editable := True;
myEvent.EndTime := SysUtils.Now - 1;
myEvent.Location := '{}';
myEvent.Participants := 'John';
myEvent.Recurring := False;
myEvent.StartTime := SysUtils.Now - 1.5;
myEvent.Subject := 'Ajax test';

end;
gamut
 
Posts: 27
Joined: 27 Apr 2013 01:54

by Jorge Sousa » 14 Jun 2013 15:33

Hi

since is an async/event, ie, Button.JQButtonOptions.OnClick.Ajax = true

you must call Button.JQButtonOptions.Reload

Best Regards

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

by esthermann » 14 Jun 2013 16:28

This is how I load them in using an ajax OnClick event:
All the items show right up.

void __fastcall TfraSchedule::IWCGJQButton3JQButtonOptionsClick(TObject *Sender, TStringList *AParams)

{
int I;
TIWCGJQSchedulerEvent *currItem;
int Hour;

schedASI->JQSchedulerOptions->EventItems->Clear();
for (int I = 0; I <= 16; I++) {
currItem =schedASI->JQSchedulerOptions->EventItems->Add();
Hour = Random(I);
currItem->StartTime = IncDay(EncodeDateTime(2013, 5, 23, Hour, 0, 0, 0),
Random(7));
currItem->EndTime = IncMinute(currItem->StartTime, 90);
currItem->ID = I;
currItem->AllDay = false;
currItem->CrossDay = false;
currItem->ColorIndex = I;
currItem->Subject = "Test" + IntToStr(I);
}
schedASI->JQSchedulerOptions->Reload();
}
esthermann
 
Posts: 171
Joined: 22 Jun 2012 11:17

by Jorge Sousa » 14 Jun 2013 17:45

Hi

Sure, my answer was wrong, sorry, thanks Esther

I mean Scheduler.JQSchedulerOptions-.Reload

not

Button.JQButtonOptions.Reload

Sorry

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

by gamut » 14 Jun 2013 23:45

Thank you both for your reply.

I had experimented earlier with the Reload function but it didn't seem to make a difference. Now I have tried again after reading your replies using a different browser and it works!

So far, I have not been able to get this to work on Chrome, IE or Firefox, but it does work on Safari for Windows. Running exactly the same program under the same conditions.

Does this make any sense?
gamut
 
Posts: 27
Joined: 27 Apr 2013 01:54

by gamut » 15 Jun 2013 09:43

Referring to my previous post, I have found that if I have an event handler in the scheduler's OnAdd event, then the events do not display in Chrome, Firefox or IE (but do display in Safari!). Removing the event handler makes the events show in all browsers.

I seem to remember someone posting a comment on this forum about this event handler causing similar problems.

I have solved my problem by removing the event handler. But I expect this might be some kind of a bug as it should be possible to use the event handler.
gamut
 
Posts: 27
Joined: 27 Apr 2013 01:54

by fduenas » 15 Jun 2013 20:12

Hi, it is really not a bug, OnADD, Ondelete, onedit are events to change (override) the behavior of the management of the events, to add our own code to override the normal. As Long as I recall, they will ad events like OnEventAdded, OnEventEdited and OnEventDeleted, so in those event we could ad dour code after events where added, modified and deleted. Don't know if they're were added or not.

This is the post: viewtopic.php?f=3&t=557

And the Quote from support.
OnAdd, OnEdit and OnDelete are are meant to be used if the user wants to replace the default behavior.
It's a good sugestion to add the events OnEventAdded, OnEventEdited and OnEventDeleted
TIWCGJQSchedulerCustomFrame has no controls
TIWCGJQSchedulerFrame descends from TIWCGJQSchedulerCustomFrame.
Best Regards
cgdevtools
fduenas
 
Posts: 124
Joined: 29 May 2012 12:54

by Jorge Sousa » 16 Jun 2013 16:24

Hi

We're developing new features on Scheduler, including the item events, and fixing the custom frame feature.

To be delivered this week.

Regards

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

by gamut » 17 Jun 2013 01:37

Fantastic

Look forward to seeing it.

Regards
John Burgess
gamut
 
Posts: 27
Joined: 27 Apr 2013 01:54


Return to JQScheduler

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.