2016-08-23 6 views
0

kendoNumericTextBoxを更新するときに、カーソルをテキストボックスに置くまで表示されません。値の設定時にKendoNumericTextboxが更新されない

$(document).ready(function() { 
 
    
 
$('#txtCorpEl').kendoNumericTextBox({}).data("kendoNumericTextBox"); 
 
    
 
$('#txtCorpEl').value(5); 
 
    
 
$('#txtCorpEl').focus(); 
 
    
 
//var numerictextbox = $("#txtCorpEl").data("kendoNumericTextBox"); 
 
//numerictextbox.focus(); 
 
    
 
}); 
 
    
 
    
 
function onChange() { 
 
    console.log("event: change"); 
 
};
<link href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.common.min.css" rel="stylesheet"/> 
 
<link href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.default.min.css" rel="stylesheet"/> 
 
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>   
 
<script src="http://cdn.kendostatic.com/2011.3.1129/js/kendo.all.min.js"></script> 
 
<input id="txtCorpEl" />

+0

代わりにjqueryのヴァルhttp://demos.telerik.com/kendo-ui/numerictextbox/api – Nikki9696

+0

グレート提案けど...「キャッチされない例外TypeErrorの価値機能を試してみてください:$(...を)。値は関数ではありません " –

+0

要素で要素を使用する必要があります。一瞬。 – Nikki9696

答えて

1

私はそれをテストするとき、これは正常に動作しています。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> 
    <link href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.common.min.css" rel="stylesheet"/> 
<link href="http://cdn.kendostatic.com/2011.3.1129/styles/kendo.default.min.css" rel="stylesheet"/> 
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>   
<script src="http://cdn.kendostatic.com/2011.3.1129/js/kendo.all.min.js"></script> 
</head> 
<body> 
<input id="txtCorpEl" /> 
<script> 
    $(document).ready(function() { 
     $("#txtCorpEl").kendoNumericTextBox(); 
    var numerictextbox = $("#txtCorpEl").data("kendoNumericTextBox"); 
numerictextbox.value(5); 
}); 
</script> 
</body> 
</html> 
関連する問題