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

OnClientTimeSlotClick change color full border.

1 Answer 26 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 2
Stefan asked on 05 Jun 2013, 10:19 AM
Hi, When someone clicks a timeslot i want to add border top to a color (100% width of scheduler).

I know this line is wrong: //args.getTimeSlotFromDomElement().style.borderColorTop = "red";

But i cant figure out how i should do it.


function OnClientTimeSlotClick(sender, args) {
                selectedResource = "";
                if (args.get_targetSlot()) {
                    selectedResource = args.get_targetSlot().get_resource().get_text();
                    var tmpTime = args.get_targetSlot().get_startTime("HH:mm");
                    var selectedTime = new Date(tmpTime);
                    selectedResourceKey = args.get_targetSlot().get_resource().get_key();
 
                    // Clears the lists
                    $('#InformationPanel ul li').html('');
                     
                    // Displays data in div.
                    $('#InformationPanel').find('.roomName').append("<strong>Rum:</strong> " + selectedResource);
                    $('#InformationPanel').find('.appointmentTime').append("<strong>Tid:</strong> " + selectedTime.format("HH:mm"));
 
 
                    activeTimeslot = args.get_targetSlot();
 
                    //args.getTimeSlotFromDomElement().style.borderColorTop = "red";
                }
            }

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 10 Jun 2013, 10:12 AM
Hi Stefan,

 
You should also set the width or the upper border to at least one pixel more than usual so it can be observed. Here is the sample code that worked at my side:

function OnClientTimeSlotClick(sender, args) {
                
               args.get_targetSlot().get_domElement().style.borderTopColor = "red";
               args.get_targetSlot().get_domElement().style.borderTopWidth = "2px"
           }

Hope this will be helpful.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Scheduler
Asked by
Stefan
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Share this question
or