Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HOW TO DRAG AND DROP IN CALENDAR ?

865646Aug 8 2011 — edited Sep 25 2012
Hi guys,

Once again I rely on your infinite wisdom to help me out with a little question I'm having regarding the Drag and Drop Functionality in the new Calendar control of the new APEX 4.1 (pretty cool by the way).

The thing is that I'm trying to create a simple little page for scheduling purposes, basically for having a centralized place in which the members of a team with a remote manager put the info of which days are they planning on working and when will they start their shift and when they gonna leave, for that purpose I made use of the new Calendar control (pretty neat) which is working fine and is being fed by the following query (note that the field "DISPLAY_COLUMN" is the value that is displayed on the calendar):

SELECT
CASE WHEN eas.IS_HOLIDAY = 1 THEN ea.FNAME || ' (OOTO Using a make up Holiday)'
WHEN eas.IS_VPN = 1 THEN ea.FNAME || ' (' || to_char(eas.SHIFT_START,'HH:MIPM') || ' - ' || to_char(eas.SHIFT_END,'HH:MIPM') || ')' || ' on VPN '
WHEN ( eas.IS_VPN = 1 AND eas.IS_HOLIDAY = 1 ) THEN ea.FNAME || ' (' || to_char(eas.SHIFT_START,'HH:MIPM') || ' - ' || to_char(eas.SHIFT_END,'HH:MIPM') || ')' || ' on VPN & its Holiday '
ELSE ea.FNAME || ' (' || to_char(eas.SHIFT_START,'HH:MIPM') || ' - ' || to_char(eas.SHIFT_END,'HH:MIPM') || ')'
END AS DISPLAY_COLUMN
, ea.ID AS ea_ID
, ea.NAME AS ea_NAME
, ea.FNAME AS ea_FNAME
, ea.EMAIL AS ea_EMAIL
, eas.ID AS eas_ID
, eas.ASSIGNEE_ID AS eas_ASSIGNEE_ID
, eas.DATE_ENTRY AS eas_DATE_ENTRY
, eas.SHIFT_START AS eas_SHIFT_START
, eas.SHIFT_END AS eas_SHIFT_END
, eas.IS_VPN AS eas_IS_VPN
, eas.IS_HOLIDAY AS eas_IS_HOLIDAY
, CASE WHEN eas.IS_VPN = 1 THEN 'VPN'
ELSE NULL END AS VPN_TEXT
, CASE WHEN eas.IS_HOLIDAY = 1 THEN 'HOLIDAY'
ELSE NULL END AS HOLIDAY_TEXT
FROM EBA_ASSIGNEES ea, EBA_ASSIGNEES_SCHEDULE eas
WHERE ea.ID = eas.ASSIGNEE_ID
ORDER BY DISPLAY_COLUMN


Alright, so far so good, everything is working just fine, the pop up window is inserting the calendar entries in the correct table as expected, but now I'd like to make use of the "Drag and Drop" functionality of this amazing control, to be able to "Clone" calendar entries in different dates instead of having the employees inserting their daily schedule for every day, so I'd like to be able to drag an existing entry from a certain day in the calendar and drop it elsewhere and I'd like the OnDemand process to make an insert on the table but with minor changes (like the date of the entry, of course) ,and I'm currently getting stuck in what to put in the OnDemand PLSQL process for that to happen (and how to reference the info in the row I'm currently dragging in the PLSQL code).


Here's the table in which I'm currently inserting the Calendar entries (and in which I want to insert the result of the drag and drop as well):

CREATE TABLE "EBA_ASSIGNEES_SCHEDULE"
( "ID" NUMBER NOT NULL ENABLE,
"ASSIGNEE_ID" NUMBER NOT NULL ENABLE,
"DATE_ENTRY" DATE NOT NULL ENABLE,
"SHIFT_START" DATE,
"SHIFT_END" DATE,
"IS_VPN" NUMBER,
"IS_HOLIDAY" NUMBER,
CONSTRAINT "EBA_ASSIGNEES_SCHEDULE_PK" PRIMARY KEY ("ID") ENABLE
) ;


Please guys, help me out here, I think this might be a simple process I just don't know how to proceed.

Thanks in advance.

Daniel Villegas.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 23 2012
Added on Aug 8 2011
7 comments
1,044 views