How do I set tab index for numeric text box.. My code is ..
$("#max_award_amount").kendoNumericTextBox({
min:0,
max: 99999999.99,
}).attr("tabindex","4");
But it is not working as expected.
How do I set tab index for numeric text box.. My code is ..
$("#max_award_amount").kendoNumericTextBox({
min:0,
max: 99999999.99,
}).attr("tabindex","4");
But it is not working as expected.
It would be more helpful to know what exactly isn't working but I will endeavor to answer anyway.
I would imagine that the reason that your code isn't working is because you are setting the tabindex on the input control after the Kendo initialization has taken place. Kendo actually hides the original input and creates it's own to use as part of the control and during this process it copies over some attributes, including tabindex.
When you call attr
as above you are setting the tabindex against the original, now hidden input control. Try setting the tabindex on the html element itself. Kendo should then copy the value when wrapping your input control.
<input id="box1" tabIndex="0" />
<script type="text/javascript">
$(function() {
$("#box1").kendoNumericTextBox();
});
</script>
EDIT
I looked into this some more and I couldn't seem to get a set of Kendo numeric textboxes to respect the tabindex that I specified.
It seems that Kendo does copy over the tabindex from the original input to the new input when constructing the textbox but it also explicitly sets the tabindex of the original input back to zero (I looked at the source code). I guess this wouldn't be so much of a problem except that when you click in the textbox the generated input is hidden and the original one is shown! So I'm not quite sure now what Kendo are trying to achieve here by creating a new input but then just hiding it and showing the old one when you click in the box.
I tried to report this bug to Kendo but alas, their forums are now "premium only". Seems like there is no way to report a bug unless you pay them. Poor show.
I got this working by setting the tabindex back on the original element after initialization.
<input id="box1" tabindex="10" />
<input id="box2" tabindex="12" />
<input id="box3" tabindex="11" />
<input id="box4" tabindex="13" />
$(function() {
$("#box1").kendoNumericTextBox()[0].tabIndex = 10;
$("#box2").kendoNumericTextBox()[0].tabIndex = 12;
$("#box3").kendoNumericTextBox()[0].tabIndex = 11;
$("#box4").kendoNumericTextBox()[0].tabIndex = 13;
});
Full demo here
We use the following:
.HtmlAttributes(new { id = "EligibleDate", tabindex = 2 })
Hope that helps.
[tabindex]="tabindex" in html kendo element
this.tabindex = 10; in ts or js
Setting tabindex for kendoDropdownList:
$("#max_award_amount").data("kendoDropdownList").wrapper.attr("tabindex",4);