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

[Solved] Drop object to scheduler

5 Answers 172 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Maria
Top achievements
Rank 1
Maria asked on 15 May 2008, 08:40 AM
Hello

i need to drop an object into scheduler. Is there any way to get time of cell by its html element?

thanks

5 Answers, 1 is accepted

Sort by
0
Doug
Top achievements
Rank 1
answered on 15 May 2008, 12:32 PM
This would be really usefull
0
Doug
Top achievements
Rank 1
answered on 15 May 2008, 12:49 PM

This is a bit of a hack, but you can add text to the css class of the time slots using the server side TimeSlotCreated event, I have added the date and time of the slot to the css class like so:

e.TimeSlot.CssClass = ";" + e.TimeSlot.Start.ToString("dd/MM/yyyy HH:mm");

NB - The ";" just makes it easier to find the start of the date time

Using the javascript event OnNodeDropping you can get the html element that you have dropped on to:

var destNode = args.get_htmlElement();

destNode.className ...
 
You can then access the css class details and parse the className propery to get the date and time.

I have viewed the html and the className property definitely contains the date time, I haven't done anymore yet, but once you have got the date and time you could force a post back and pass the date and time as an argument and do somthing with it on the server side e.g. create another appointment in the scheduler. Like I said a bit of a hack.

What would be good though is if the time cells had a unique ID property that could be set or ideally drag and drop would work with divs as it does with other controls, but to be fair the scheduler control is excellent.

Hope this helps

Doug.

0
Doug
Top achievements
Rank 1
answered on 15 May 2008, 03:24 PM
Just to confirm the above method does work, all be it a hack.
0
T. Tsonev
Telerik team
answered on 15 May 2008, 03:46 PM
Hello,

Great workaround Doug. Fortunately, we have taken care of this problem and the Q1 release supports the notion of time slots that have unique indexes. I am attaching a draft version of an example that demonstrates drag and drop between RadTreeView and RadScheduler. It includes client-side code to locate the time slot, the time can be obtained by calling its get_startTime() method.

The project is built against the latest SP1 build (trial included).

Kind regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Doug
Top achievements
Rank 1
answered on 15 May 2008, 03:54 PM
Thanks Tsvetomir,

That sounds like a better way to do it.

I must say that I am impressed with the quick turn around, I am also very impressed by the whole toolkit, certainly takes web projects to the next level.

Best Regards

Doug
Tags
Scheduler
Asked by
Maria
Top achievements
Rank 1
Answers by
Doug
Top achievements
Rank 1
T. Tsonev
Telerik team
Share this question
or