level 1
cepapa22
楼主
在numberbox控件里,onChange事件无法给自己设定特定值,但是可以给其他numberbox设定特定值。测试代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic ComboBox - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css"
href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
<script type="text/javascript">
function f2(n,o){
var i1=$(*input#i1*);
var i2=$(*input#i2*);
i1.numberbox(*setValue*,1);
i2.numberbox(*setValue*,2);
}
</script>
</head>
<body>
<h2>Basic ComboBox</h2>
<p>Type in ComboBox to try auto complete.</p>
<div style="margin:20px 0"></div>
<input id=*i1* class="easyui-numberbox">
<input id=*i2* class="easyui-numberbox" data-options="onChange:function(n,o){f2(n,o)}">
</body>
</html>
改变i2的值使i1的值设为1,成功
同时将i2本身的值设为2,失败
值得一提的是将i2.numberbox(*setValue*,n-1);会成功,并且递归调用直到栈溢出。
我的问题:这算不算个BUG?
2014年08月25日 07点08分
1
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Basic ComboBox - jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css"
href="../../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
<link rel="stylesheet" type="text/css" href="../demo.css">
<script type="text/javascript" src="../../jquery.min.js"></script>
<script type="text/javascript" src="../../jquery.easyui.min.js"></script>
<script type="text/javascript">
function f2(n,o){
var i1=$(*input#i1*);
var i2=$(*input#i2*);
i1.numberbox(*setValue*,1);
i2.numberbox(*setValue*,2);
}
</script>
</head>
<body>
<h2>Basic ComboBox</h2>
<p>Type in ComboBox to try auto complete.</p>
<div style="margin:20px 0"></div>
<input id=*i1* class="easyui-numberbox">
<input id=*i2* class="easyui-numberbox" data-options="onChange:function(n,o){f2(n,o)}">
</body>
</html>
改变i2的值使i1的值设为1,成功
同时将i2本身的值设为2,失败
值得一提的是将i2.numberbox(*setValue*,n-1);会成功,并且递归调用直到栈溢出。
我的问题:这算不算个BUG?