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

Remove clickable of row date header

10 Answers 184 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
vin
Top achievements
Rank 1
vin asked on 09 Apr 2009, 06:39 AM
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?

10 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 10 Apr 2009, 02:02 PM
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.
0
vin
Top achievements
Rank 1
answered on 17 Apr 2009, 07:03 AM
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
0
Alex Gyoshev
Telerik team
answered on 20 Apr 2009, 08:02 AM
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.
0
Support Riskminder
Top achievements
Rank 1
answered on 10 Feb 2011, 02:32 PM
Hi
How do i use this script ..

i get "Sys is undefined"

BEst regards
Bo
0
Yana
Telerik team
answered on 10 Feb 2011, 05:35 PM
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.
0
David
Top achievements
Rank 1
answered on 11 Aug 2011, 01:46 PM
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
0
Helen
Telerik team
answered on 11 Aug 2011, 06:47 PM
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.

0
Steve
Top achievements
Rank 2
answered on 26 Oct 2011, 05:17 AM
Update to the "match" error?  I get it as well and would love to see a resolution.
0
Plamen
Telerik team
answered on 27 Oct 2011, 10:32 AM
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
0
Hardy
Top achievements
Rank 1
answered on 27 Oct 2011, 11:46 AM
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
Tags
Scheduler
Asked by
vin
Top achievements
Rank 1
Answers by
Yana
Telerik team
vin
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Support Riskminder
Top achievements
Rank 1
David
Top achievements
Rank 1
Helen
Telerik team
Steve
Top achievements
Rank 2
Plamen
Telerik team
Hardy
Top achievements
Rank 1
Share this question
or