Reputation: 11984
I am using the following code to create a kendo numeric textbox.
Html
<input type='text' name='num_wks_or_mons' id='num_wks_or_mons' tabindex='5'/>
Jquery
$("#num_wks_or_mons").width(295).kendoNumericTextBox({
min:0,
max:99,
step:1,
format: "n0"
});
Evenif i am setting the tabindex
attribute as 5 the element will not get the focus if if tabout from elemnent with tabindex = 4
.When i tabout from element with tabindex = 4
the focus is going to the next element which is not a kendo numeric textbox.
Upvotes: 3
Views: 4884
Reputation: 11
Try to this:
var $nodeNumeric = $nodeImput.kendoNumericTextBox().data("kendoNumericTextBox");
$($nodeNumeric._text).focus();
Upvotes: 1
Reputation: 323
The Kendo UI Numeric Text Box widget has it's own focus method. Get the instance of the widget and call that.
var numerictextbox = $("#num_wks_or_mons").data("kendoNumericTextBox");
numerictextbox.focus();
https://docs.telerik.com/kendo-ui/api/javascript/ui/numerictextbox/methods/focus
Upvotes: 1
Reputation: 324
Set focus like this,
$('#num_wks_or_mons').siblings('input:visible').focus();
Upvotes: 7
Reputation: 26
<script type="text/javascript">
$(document).ready(function () {
setTimeout(function() {
$('#txtThresholdAmount').siblings('input:visible').focus();
}, 1000);
});
</script>
Upvotes: 0
Reputation: 8020
Set focus like this,
setTimeout("$('#num_wks_or_mons').focus();", 500);
Upvotes: 0