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

Set appointment to visible with JS

8 Answers 90 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Web Services
Top achievements
Rank 2
Web Services asked on 16 Sep 2009, 09:42 PM
I'm sure it's something stupid but I load a rad scheduler with appointments and they are all set visible to false. I then load a rad tree view with child nodes that have the same value as the radscheduler appointment's ids. However, when you check a child node I get the error in my JS debugger saying scheduler.get_appointments().findByID(value) is null

               //assume this is the correct ID for the rad scheduler
                var value = eventArgs.get_node().get_value();

                //the instance of the scheduler
                scheduler = $find('<%=RadScheduler1.ClientID %>');

                var appDivID = "#" + scheduler.get_appointments().findByID(value).get_element().id;
                    appDivID.parent().show();  

What am I doing wrong here? Thanks,

8 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 17 Sep 2009, 03:21 PM
Hello,

scheduler.get_appointments() will return only visible appointments. Therefore, if you set the appointment Visible property to false, you won't be able to find the appointements on the client with findByID().



Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Web Services
Top achievements
Rank 2
answered on 17 Sep 2009, 03:41 PM
So since I have to hide all of the events on the page load, how would you suggest I use javascript to show the event.
0
Peter
Telerik team
answered on 17 Sep 2009, 03:58 PM

Please, see the other forum thread about this issue:
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/show-hide-appointments.aspx#927187

We suggest you hide the appointments using jQuery like this:

var $ = $telerik.$;
$(document).ready(function() {
$(".rsApt").parent().hide();
});



Regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Web Services
Top achievements
Rank 2
answered on 17 Sep 2009, 04:38 PM
I have tried to use that code, but it never worked and even if I got it to work, it won't solve the problem in my case. The reason being, I can't build my rad tree off of my calendar because the rad tree has parent and child items and the calendar does not. If you go to http://alpha.clickablecommunity.com/Calendar.aspx you will see what I need my treeview to look like. I am loading the events right now so you can see them. But, I will set visible = false when it is live and I would like to show them when a user clicks a child node. How do you suggest I go about that.
0
Peter
Telerik team
answered on 18 Sep 2009, 09:57 AM
Hi,

You can build RadTreeview as per your requirement, but you have to hide the appointments using jQuery as shown in my previous post. In that case you can use scheduler.get_appointments().findByID() to display a specific appointment.


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Web Services
Top achievements
Rank 2
answered on 18 Sep 2009, 04:22 PM
When I try to use your Jquery code, I get an error from the very first line saying $telerik is not defined from the very first line var $ = $telerik.$; any ideas why?
0
Accepted
Dimitar Milushev
Telerik team
answered on 22 Sep 2009, 04:28 PM
Hi,

This means that jQuery isn't loaded yet. You should move the code at the bottom of the page so it is executed after the jQuery registration. Also, make sure you are not using an old version of RadControls from before the controls used integrated jQuery. You can also try moving the code inside the pageLoad() function to ensure it is executed after everything on the page is initialized.

Sincerely yours,
Dimitar Milushev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Web Services
Top achievements
Rank 2
answered on 22 Sep 2009, 05:48 PM
That was the whole problem. The jquery wasn't loaded. I have spent so much time trying to figure this out. Thanks,
Tags
Scheduler
Asked by
Web Services
Top achievements
Rank 2
Answers by
Peter
Telerik team
Web Services
Top achievements
Rank 2
Dimitar Milushev
Telerik team
Share this question
or