user869375
user869375

Reputation: 2419

KendoUI multiple datepickers open on focus angularjs

I am using KendoUI datepicker (http://demos.telerik.com/kendo-ui/datepicker/angular) in my angularjs application. I have a page with multiple datepickers (using ng-Repeat) and want to open the datepicker when I click on the input. I know we can do it using following code snippet and attach this code to ngClick event of input/span, but this relies on the IDs and with multiple datepickers on page, its not the optimal solution.

var datePicker = $('#yourDatePickerInputId').data("kendoDatePicker");
if ($('#yourDatePickerInputId_dateview').css('display') == 'none') {
    datePicker.open();
} else {
    datePicker.close();
}

Can someone provide a working fiddle for this?

Upvotes: 0

Views: 413

Answers (1)

Kunvar Singh
Kunvar Singh

Reputation: 1885

You may Try for This:

Here i have added 1 class for input fields(i,e openMe) and click function i have open the datepicker.

http://dojo.telerik.com/ebETo

Upvotes: 1

Related Questions