我有一个使用高速缓存的值,以显示给用户的MVC视图经由旁路值小部件
@Html.TextboxFor(x => x.SomeInteger, new { @class="selector" });
和类似的构造。
我的问题是,当我做到这一点
$(“.selector”).wijinputnumber({
type: ‘numeric’,
minValue: 0,
decimalPlaces: 0,
showSpinner: true
});
文本框中的值被设置为0,但(例如)的用户可能已投入4之前,我需要它来反映这一点。另外,我已经证实我的模型实际上在SomeInteger属性中有4个,所以不是这样。
有没有办法告诉wijinputnumber不设置初始值?
这里只是HTML和Wijmo/jQuery的一个完整的例子出现此问题:
<!DOCTYPE HTML>
<html>
<head>
<link href="http://cdn.wijmo.com/themes/rocket/jquery-wijmo.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.wijmo.com/jquery.wijmo-open.1.1.2.css" rel="stylesheet" type="text/css" />
<link href="http://cdn.wijmo.com/jquery.wijmo-complete.1.1.2.css" rel="stylesheet" type="text/css" />
<script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.min.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/external/jquery.bgiframe-2.1.3-pre.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/external/jquery.glob.min.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/external/jquery.mousewheel.min.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/external/raphael-min.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/jquery.wijmo-open.1.1.2.min.js" type="text/javascript"></script>
<script src="http://cdn.wijmo.com/jquery.wijmo-complete.1.1.2.min.js" type="text/javascript"></script>
</head>
<body>
<input type="text" class="correct" value="5" />
<input type="text" class="notcorrect" value="10" />
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.correct').wijtextbox();
$(".notcorrect").wijinputnumber({
type: 'currency',
decimalPlaces: 2,
showGroup: true,
showSpinner: true
});
});
</script>
</body>
</html>
该死的,我也应该在这里回答它!可能得到了信用。 ;)感谢发布答案哥们。 – Banzor 2011-03-30 17:06:47