This is a migrated thread and some comments may be shown as answers.

[Solved] Drag row from Radgrid to one of the Schedulers

1 Answer 93 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Hrushikesh Mokashi
Top achievements
Rank 1
Hrushikesh Mokashi asked on 31 Mar 2009, 10:11 AM
Hi All,

I am having three Radscheduler controls on my form and a radgrid.

I am adding Drag-Drop facility from radgrid to any of the Radschedulers.

I have written a function on rowDropping of Radgrid.

 

function rowDropping(sender, eventArgs)

 

{

 

var htmlElement = eventArgs.get_destinationHtmlElement();

 

 

var scheduler = $find('<%= radScheduleCalender1.ClientID %>');

 

 

 

if (isPartOfSchedulerAppointmentArea(htmlElement))

 

{

 

// The row was dropped over the scheduler appointment area

 

 

// Find the exact time slot and save its unique index in the hidden field

 

 

var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);

 

 

//$get("TargetSlotHiddenField").value = timeSlot.get_index();

 

 

 

// The HTML needs to be set in order for the postback to execute normally

 

eventArgs.set_destinationHtmlElement(

"hFieldGridDropData");

 

}

 

else

 

{

 

// The node was dropped elsewhere on the document

 

eventArgs.set_cancel(

true);

 

}

}

 

 

function isPartOfSchedulerAppointmentArea(htmlElement)

 

{

 

// Determines if an html element is part of the scheduler appointment area

 

 

// This can be either the rsContent or the rsAllDay div (in day and week view)

 

 

return $telerik.$(htmlElement).parents().is("div.rsAllDay") ||

 

$telerik.$(htmlElement).parents().is(

"div.rsContent")

 

}


In the code currently, I am using object of first Radscheduler.
i.e. "var scheduler = $find('<%= radScheduleCalender1.ClientID %>'); "
Instead of hardcoding I want to get ID of the Radscheduler on which user will be dropping an item.

Can anyone help me out please ?

Also, the line

 

 

" $telerik.$(htmlElement).parents().is("div.rsAllDay") || $telerik.$(htmlElement).parents().is("div.rsContent")" is giving an error " Object does not supports this property".


Best Regards,
Hrushikesh.

 

1 Answer, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 03 Apr 2009, 01:37 PM
Hello Hrushikesh Mokashi,

Please find attached a sample project which demonstrates how to get the ID of the scheduler on which you drop the row.

Greetings,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
Hrushikesh Mokashi
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Share this question
or