Hello,
Once created, many Kendo components root DOM element are wrapped under new HTML elements. Any class of the original input will also be copied to some parent elements.
Ex:
Notice kendo added the MyClass to the span wrapper at line #1 and #3 once the DateTimePicker is created.
When you access the root input (line #3) with the ID, there's no problem.
However, if you want to use the class, then is getting more tricky.
As each widget (DateTimePicker, DropDownList, ComboBox...) are wrapped differently, it might be a good idea to add a class to the root input that would allow us to spot the input we are looking for?
Once created, many Kendo components root DOM element are wrapped under new HTML elements. Any class of the original input will also be copied to some parent elements.
Ex:
1.
<input type=
"text"
class=
"MyClass"
/>
Notice kendo added the MyClass to the span wrapper at line #1 and #3 once the DateTimePicker is created.
1.
<span class=
"k-widget k-datetimepicker k-header MyClass"
style=
"width: 200px;"
>
2.
<span class=
"k-picker-wrap k-state-default"
>
3.
<input id=
"mydatetimepicker"
style=
"width: 100%;"
data-role=
"datetimepicker"
type=
"text"
class=
"k-input MyClass"
role=
"textbox"
aria-haspopup=
"true"
aria-expanded=
"false"
aria-disabled=
"false"
aria-readonly=
"false"
aria-label=
"Current focused date is 5/22/2013 9:50:42 AM"
>
4.
<span unselectable=
"on"
class=
"k-select"
>
5.
<span unselectable=
"on"
class=
"k-icon k-i-calendar"
role=
"button"
aria-controls=
"datetimepicker_dateview"
>select</span><span unselectable=
"on"
class=
"k-icon k-i-clock"
role=
"button"
aria-controls=
"datetimepicker_timeview"
>select</span>
6.
</span>
7.
</span>
8.
</span>
When you access the root input (line #3) with the ID, there's no problem.
1.
$(
'#mydatetimepicker'
)
2.
//Will return the input of line 3
However, if you want to use the class, then is getting more tricky.
1.
$(
'.MyClass'
)
2.
//Will return the span of line 1 and the input of line 3
As each widget (DateTimePicker, DropDownList, ComboBox...) are wrapped differently, it might be a good idea to add a class to the root input that would allow us to spot the input we are looking for?