CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Schedular stop adding/ updating Event

by Alexander Bulei » 15 Oct 2014 11:10

Hi Eric,

We have implemented new property ShowEditBtnOnNewEvent

Code: Select all
2.3.0.69

JQScheduler:
- Added: new property ShowEditBtnOnNewEvent - Show / Hide the Edit button on new event (Default: False) - This is a feature of jquery plugin, but doesn't make sense on new event creation.



This will solve the issue.

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

by etwoss » 15 Oct 2014 15:15

Hi

You say "This solves the issue"

This issue?

Hi

I noticed that the event is redrawn at its place when i raise an error, only the Event itself in the eventlist still has new values and not set back to original values.

Example:

Event on 1-1-2014 10:00 - 12:00

Drag it to 2-1-2013 14:00-16:00

raise an error

The event is redrawn at 1-1-2014 10:00 - 12:00
Now when i open it, and copy the event start and end time to the details form, it still holds 2-1-2013 14:00-16:00

I have fixed this when raising the error, but think would be better if you handle this in your code
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 15 Oct 2014 15:17

Hi Eric,

Yes!

The main problem is in editing of new event.

Edit button doesn't make sense on new event creation.

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

by etwoss » 16 Oct 2014 07:51

Hi

Do you mean the small dialog has no "Edit" button anymore?

Just saw its a property, but when i set it to true , and close the details dialog, a Ghost record is still there?

I don't hope so.

I made my application this way:

- an user can create a simple event without having to use the details dialog
- an user can create a detailed event by using the edit button directly on the small dialog


I try to test it this evening

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Alexander Bulei » 16 Oct 2014 09:33

Hi Eric,

Well, if you need the edit button on "new event dialog", just set that property to true.

To avoid the "ghost" records on cancel(close), you need assign the OnClose event of dialog and put the follow code:

delphi code
procedure TJQCustomEventFrame.IWFrameRegionJQDialogOptionsClose(Sender: TObject; AParams: TStringList);
var
Event: TIWCGJQSchedulerEvent;
JS: string;
begin
if Assigned(CurrentEvent) and (CurrentOperation = soNew) then
begin
Event:= CurrentEvent as TIWCGJQSchedulerEvent;
if Event.List.Options.Scheduler.EventSaved then
begin
JS:= Format('var ui=%s;',[Event.CGJSContainer.IDJQuery]);
JS:= JS + 'ui[0].bcal.releaseDragEvent();';
Event.CGJSContainer.AddJavaScriptToAjaxResponse(JS);
Event.Free;
end;
end;
end;


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

by etwoss » 16 Oct 2014 14:40

Hi

Great, will try it!

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by etwoss » 01 Nov 2014 08:36

Ji

Where is CurrentEvent and CurrentOperation come from is this example?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by etwoss » 03 Nov 2014 09:08

Hi

Tried to delete last post, but does not work
I have seen where i have to implement this, and first tests look Ok.

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 03 Nov 2014 11:04

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

by etwoss » 15 Nov 2014 10:13

Hi Jorge

Just today i had enough time to test the Schedular again and found the following:

- Set ShowEditBynOnNewEvent to Trie

Add your sample code to the Close event of the IWFrameRegion:

Code: Select all
procedure TJQCustomEventFrame.IWFrameRegionJQDialogOptionsClose(Sender: TObject;
  AParams: TStringList);
var
  Event: TIWCGJQSchedulerEvent;
  JS: string;
begin
  if Assigned(CurrentEvent) and (CurrentOperation = soNew) then
  begin
    Event:= CurrentEvent as TIWCGJQSchedulerEvent;
    if Event.List.Options.Scheduler.EventSaved then
    begin
      JS:= Format('var ui=%s;',[Event.CGJSContainer.IDJQuery]);
      JS:= JS + 'ui[0].bcal.releaseDragEvent();';
      Event.CGJSContainer.AddJavaScriptToAjaxResponse(JS);
      Event.Free;
    end;
  end;
end;


Start testing:

1 Browse to a week without events
2 Create an event, no text added but directly go to "Details" and directly choose "Close"
3 The code hits the Close event but the row:

if Event.List.Options.Scheduler.EventSaved then

result to true so event stays drawn where it should be deleted
As soon as i create another event its gone!

The strange thing is that this is not always the fact in my code, sometimes it will be deleted also. But as of the moment one is not deleted, no new events will be deleted anymore when needed.

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

PreviousNext

Return to JQScheduler

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.