Remove clickable of row date header

11 posts, 1 answers
  1. vin
    vin avatar
    22 posts
    Member since:
    Apr 2009

    Posted 09 Apr 2009 Link to this post

    Hi,
    In my schedular i am using  month view only.but in the row date header ,when i click it goes to its corresponding date view. For example for april 6 when i click the 6,it will go to day view of 6.I don want to display day view.how can i remove click of date header?
  2. Answer
    Yana
    Admin
    Yana avatar
    4993 posts

    Posted 10 Apr 2009 Link to this post

    Hello Vin,

    I suggest you use NavigationCommand event to prevent this behavior. You can read more about this here.

    Best wishes,
    Yana
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. vin
    vin avatar
    22 posts
    Member since:
    Apr 2009

    Posted 17 Apr 2009 Link to this post

    thanks for ur help.i could solve..but do u know how can we remove that clickability..now one hand cursor is showing in date
  4. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2527 posts

    Posted 20 Apr 2009 Link to this post

    Hello Vin,

    To remove the links, you can use the following JavaScript:

    <script type="text/javascript">
        Sys.Application.add_load(function () {
            $telerik.$('.RadScheduler .rsDateHeader').each (function () {
                var that = $telerik.$(this);
               
                $telerik.$('<span class="rsDateHeader"></span>')
                    .text(that.text())
                    .insertAfter(that);
                   
                that.remove();
            });
        });
    </script>


    Regards,
    Alex
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Support Riskminder
    Support Riskminder avatar
    45 posts
    Member since:
    Apr 2007

    Posted 10 Feb 2011 Link to this post

    Hi
    How do i use this script ..

    i get "Sys is undefined"

    BEst regards
    Bo
  6. Yana
    Admin
    Yana avatar
    4993 posts

    Posted 10 Feb 2011 Link to this post

    Hi Bo,

    You should place it after the script manager.

    Hope this helps.

    Best wishes,
    Yana
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  7. David
    David avatar
    8 posts
    Member since:
    Nov 2010

    Posted 11 Aug 2011 Link to this post

    This is the solution I was looking for..
    The links are gone but when I click on the number of the day I get an error :

    Uncaught TypeError: Cannot call method 'match' of undefined
    b.RadScheduler._onDateHeaderClick
    Telerik.Web.UI.Scheduler.EventMap._onDomEvent
    (anonymous function)

    in ScriptResource.axd
  8. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 11 Aug 2011 Link to this post

    Hello David,

    Could you please open a support ticket and send us a sample code which demonstrates the issue to examine it locally?

    Kind regards,
    Helen
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  9. Steve
    Steve avatar
    60 posts
    Member since:
    Nov 2006

    Posted 26 Oct 2011 Link to this post

    Update to the "match" error?  I get it as well and would love to see a resolution.
  10. Plamen
    Admin
    Plamen avatar
    3056 posts

    Posted 27 Oct 2011 Link to this post

    Hi Steve,

    If you are trying to forbid going to DayView after clicking in a MonthView's cell you can try to use this javascript which doesn't throw errors at my side:
    Copy Code
    function pageLoad(sender, args) {
    $ = $telerik.$;
    vara = $(".rsDateHeader").click(function (e) { return false; });
    }

    If you want to remove the hover style you can also add this:
    Copy Code
    <style type="text/css">
    .rsDateHeader:hover
    {
    text-decoration: none !important;
    cursor: default !important;
    }
    </style>

    I hope this helps.

    Kind regards,
    Plamen Zdravkov
    the Telerik team
    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 their blog feed now
  11. Hardy
    Hardy avatar
    5 posts
    Member since:
    Sep 2012

    Posted 27 Oct 2011 Link to this post

    If you not only want to prevent the javascript error but also remove the links you can use the following (slightly modified) version of the solution presented by Alex:
    <script type="text/javascript">
        Sys.Application.add_load(function () {
            $telerik.$('.RadScheduler .rsDateHeader').each(function () {
                var that = $telerik.$(this);
      
                that.parent().click(function (evt) {
                    evt.stopPropagation();
                    evt.preventDefault();
                });
      
                $telerik.$('<span class="rsDateHeader"></span>')
                        .text(that.text())
                        .insertAfter(that);
      
                that.remove();
            });
        });
              
    </script>

    In addition to replacing the link with a span, as Alex suggested, this script also makes sure that clicks on the calendar cells won't bubble up the element tree, which prevents the click handler that throws the error from being called.

    Cheers,

    Hardy
Back to Top