У меня есть вид MVC, который использует кэшированные значения для отображения пользователю через
@Html.TextboxFor(x => x.SomeInteger, new { @class="selector" });
и аналогичные конструкции.
Моя проблема в том, что когда я делаю это
$(“.selector”).wijinputnumber({
type: ‘numeric’,
minValue: 0,
decimalPlaces: 0,
showSpinner: true
});
Значение текстового поля устанавливается равным 0, но (например) пользователь мог вставить 4 ранее, и мне нужно, чтобы это отражалось. Кроме того, я проверил, что у моей Модели действительно есть 4 в свойстве SomeInteger, так что это не так.
Есть ли способ указать 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>