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

Disabling of Click on TopHeader of DatePicker for changing Years

1 Answer 41 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nikhil Kashyap
Top achievements
Rank 1
Nikhil Kashyap asked on 20 Jul 2010, 12:51 PM
Hi,
    I want to disable the click functionality on the header of the datepicker from where we directly select the year after opening the datepicker control. I want that disabled. Screenshot attached for reference.
Could you plz tell how to do this?

Regards,
Customer ID : JT359876
Nikhil Kashyap

1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 20 Jul 2010, 02:12 PM
Hi Nikhil Kashyap,

To achieve your goal you need to overried show method in the telerik.datepicker.js file like so:
[OLD]
show: function () {
    $t.trigger(this.element, 'open');
    this.showPopup();
},

[NEW]
show: function () {
    this.showPopup();
    $t.trigger(this.element, 'open');
},

Thus you can wire OnOpen event of the datepicker and set 't-state-disabled' to disabled clicking on the year:
[Event handler]
function OnOpen(e) {
            $(this).data('tDatePicker').$calendar().find('.t-nav-fast').addClass('t-state-disabled');
        }

I confirm that change to the show() method will be included in the next official release of the Telerik Components for ASP.NET MVC.

Kind regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Date/Time Pickers
Asked by
Nikhil Kashyap
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or