我有以下KendoUI模板绑定到一个可观察的。当我把一个新的项目,以可观察到的阵列,如何申请的kendoNumericTextBox只对新项目的模板?KendoUI模板与可观察与NumericTextbox
如果我申请的类,它在现有的数字文本框的纺纱翻番的奇效。
<div id="slots">
<table class="table table-striped table-condensed" style="width:auto;">
<thead>
<tr>
<th>Date</th>
<th>Time</th>
<th>Volunteers Needed</th>
<th>
Reservation Passcode <i class="icon-question-sign" title ="Only people with the reservation passcode can signup."></i>
</th>
</tr>
</thead>
<tbody data-template="row-template" data-bind="source: slots">
</tbody>
</table>
</div>
$(document).ready(function() {
var viewModel = kendo.observable({
slots: [{DateText:'1/8/1969', ShiftLabel: "3:00 to 5:00",Slots:2,ReservationCode:"ABC" }]
});
kendo.bind($("#slots"), viewModel);
$(".numeric").kendoNumericTextBox({
format: "n0"
});
viewModel.slots.push({DateText:'1/8/1969', ShiftLabel: "3:00 to 5:00",Slots:2,ReservationCode:"ABC" });
$(".numeric").kendoNumericTextBox({
format: "n0"
});
});
感谢您的帮助!
感谢。数据角色工作得很好。 – scottrakes 2013-03-06 01:28:47
使用'data-format =“n0”'(我已经更新了包含它的答案)。 – OnaBai 2013-03-06 07:30:54