没有与传递参数,当我按下按钮,没有什么问题,也有在控制台中没有错误Knockout.js - 传递参数
<tbody data-bind="foreach: hotels">
<tr>
<td data-bind="text: Id"></td>
<td data-bind="text: Name"></td>
<td data-bind="text: Address"></td>
<td>
<button data-bind="click: $root.eksportuj" > @Html.Text("Eksportuj")/button>
</td>
</tr>
和
self.eksportuj = function (obj, event) {
$.ajax({
ulr: "@Url.Action("eksport", "Controller")",
type: 'POST',
data: {'Id' : obj.Id},
success: function (result)
{
alert("True");
},
error: function()
{
alert("Error");
}
});
}
是'obj.Id'可观察到的? – haim770 2014-11-04 10:16:50