我怎样才能有剑道NumericTextBox在突出显示在剑道窗口中保持焦点? [英] How can I have kendo NumericTextBox keep focus during highlighting in a kendo window?

查看:488
本文介绍了我怎样才能有剑道NumericTextBox在突出显示在剑道窗口中保持焦点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $('input')。kendoNumericTextBox({ 
小数点:2,
spinners:false
});

$ b $('#win')。kendoWindow({
modal:true,
width:969px,
height:646px ,
title:NumericTextBoxTest
});
$ b $('#win')。data('kendoWindow')。center()。open();

jsfiddle在这里 http://jsfiddle.net/e6shF/40/

在Firefox中,您无法突出显示数字文本框值。在Chrome中,您可以突出显示该值,但在高亮显示时不能键入该值。

由于z-indexing不当,这似乎是焦点问题。我正在使用kendo版本2012.3.1114(最新的GPL版本)。这个问题在kendo版本2012.3.1315中不再存在,但是该版本在GPL下似乎不可用。如何使用kendo 2012.3.1114解决此问题?

解决方案

将.focus()事件侦听器添加到输入中,在setTimeout中使用input.select()似乎强制它正常运行。

$ $ $'code $('input')。kendoNumericTextBox ({
小数:2,
spinners:false
})。focus(function(){
var input = $(this); $ b $ setTimeout(function ){
input.select();
});
});

小提琴: http://jsfiddle.net/HwrzV/1/

现在适用于Firefox和Chrome。试图测试IE8但JSFiddle不加载。 :x


I have a kendo window that contains a kendo numeric text box:

$('input').kendoNumericTextBox({
    decimals: 2,
    spinners: false
});


 $('#win').kendoWindow({
     modal: true,
     width: "969px",
     height: "646px",
     title: "NumericTextBoxTest"
 });

 $('#win').data('kendoWindow').center().open();

The jsfiddle is here http://jsfiddle.net/e6shF/40/.

In Firefox, you are unable to highlight the numeric text box value. In Chrome, you can highlight the value but can't type over the value while it is highlighted.

It appears to be a focus issue due to improper z-indexing. I'm using kendo version 2012.3.1114 (latest GPL release). This issue is no longer present in kendo version 2012.3.1315 but that version doesn't appear to be available under GPL. How can I resolve this issue using kendo 2012.3.1114?

解决方案

Adding a .focus() event listener to the input, wrapped in a setTimeout with an input.select() seems to force it to behave normally.

$('input').kendoNumericTextBox({
    decimals: 2,
    spinners: false
}).focus(function() {
   var input = $(this);
    setTimeout(function() {
        input.select();
    });
});

Fiddle: http://jsfiddle.net/HwrzV/1/

Works for me now in Firefox and Chrome. Tried to test IE8 but JSFiddle doesn't load. :x

这篇关于我怎样才能有剑道NumericTextBox在突出显示在剑道窗口中保持焦点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆