0
現在のアイテムを削除するボタンが付いた剣道グリッドがあります。グリッドには行テンプレートがあります。私は剣道のクリックイベントをバインドできませんmvvmの行テンプレート
kendo.binder.min.js?cdv=40:25 Uncaught TypeError: t.get is not a function(…)
場合:
<div class="form-horizontal">
<table class="fixed-table-width"
data-role="grid"
data-bind="source: data"
data-scrollable="false"
data-row-template="row-template">
<thead>
<tr>
<th>Item</th>
<th></th>
</tr>
</thead>
</table>
</div>
<script type="text/x-kendo-tmpl" id="row-template">
<tr>
<td><span data-bind="text: item"></span></td>
<td><button class="link" data-bind="click: remove"><i class="icon-trash"></i> Remove</button></br ></td>
</tr>
</script>
そして、それは私のモデルである:ここに私のHTMLはある
function AddItemComponent($scope) {
if ($scope === null || $scope === undefined) throw new Error("Unknown scope, please provide the scope");
var self = this;
self.itemModel = {
item: "Item to Remove",
remove: function(i) {
self.viewModel.items = self.viewModel.items.splice(i);
}
};
self.viewModel = kendo.observable({
items: []
});
self.viewModel.items.push(self.itemModel);
};
しかし、私はこのHTMLをモーダルを開くと、私は次のエラーを取得しますデータバインドをクリックイベントから削除すると、エラーはなく、うまくいきます。何が問題なのですか?あなたが達成しようとしている何