Set appointment to visible with JS

9 posts, 1 answers
  1. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 16 Sep 2009 Link to this post

    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,

  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 17 Sep 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 17 Sep 2009 Link to this post

    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.
  5. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 17 Sep 2009 Link to this post


    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.
  6. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 17 Sep 2009 Link to this post

    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.
  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 18 Sep 2009 Link to this post

    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.
  8. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 18 Sep 2009 Link to this post

    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?
  9. Answer
    Dimitar Milushev
    Admin
    Dimitar Milushev avatar
    555 posts

    Posted 22 Sep 2009 Link to this post

    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.
  10. Web Services
    Web Services avatar
    243 posts
    Member since:
    Apr 2008

    Posted 22 Sep 2009 Link to this post

    That was the whole problem. The jquery wasn't loaded. I have spent so much time trying to figure this out. Thanks,
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017