我可以调用form
从另一个addAnother
显式调用的自定义绑定调用的自定义绑定吗?我还可以修改进入父自定义绑定的参数吗?
ko.bindingHandlers.addAnother = {
init: function (element, valueAccessor) {
$(element).click(function () {
//$(element).parents('form')....
});
}
};
<form class="box clearfix" action="@Request.RawUrl" data-bind="form:{ id: @Model.Division.Id }">
@Html.Partial("EditorTemplates/Division", Model.Division)
<div class="control-group">
<div class="controls">
@Html.Partial("EditorTemplates/Button")
<button class="btn btn-inverse" data-bind="addAnother: { }"><i class="icon-save icon-white"></i> Save +</button>
</div>
</div>
</form>