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

Kendo Date Picker selection by class name with JQuery

1 Answer 1053 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 22 Mar 2017, 04:49 PM

How do i get the value of a Kendo Date Picker by class name. The reason being is because im using the name and id attributes for something else. As you can see below the class attribute is dynamic. Every other time ive selected a Kendo Date Picker, i've always used the ID attribute. Is it possible to select by class attribute?

@Html.Kendo().DatePicker()
              .Name("SurveyResponse.DateRes[" + @guid + "].Date")
              .Format("MM/dd/yyyy")
              .HtmlAttributes(new {
                       onkeydown = "javascript:return false;",
                       onblur = "ConditionalTextBox(" + @item.SurveyQuestionID + ",'datecontrol')",
                       @placeholder = "Your answer",
                       @required = "required",
                       @class = "IsConditionalTextBox_" + @item.SurveyQuestionID
                       })

1 Answer, 1 is accepted

Sort by
1
Konstantin Dikov
Telerik team
answered on 24 Mar 2017, 12:57 PM
Hello Richard,

It is not mandatory to use the ID of the input element when you need to get reference to the API of the widget and you can use any selector that will find the corresponding INPUT element. Here is a simple example with custom class name:
$(".yourClassName.k-input").data("kendoDatePicker")

Please feel free to contact us again if other questions arise on this matter.


Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Date/Time Pickers
Asked by
Richard
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or