Reputation: 2419
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
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.
Upvotes: 1