期间复选框在淘汰赛绑定错误,我得到一个错误:获取序列化
Uncaught InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('checkbox') does not support selection.
上:
<div class="panel-heading paddingRight20px">
<input style="position: absolute;" type="checkbox" data-bind="checked: IsSelectedCoverage" />
</div>
当我调试的代码,我发现,这是给这个错误当我试图序列化视图模型(其中有IsSelectedCoverage
可观察)。
Ajax调用我在哪里序列化:
self.finish = function() {
debugger;
var CorrespondenceData = ko.toJSON(self);
$.ajax({
url: endPoints.Finish + '/' + self.MemberId(),
type: 'POST',
dataType: 'json',
data: CorrespondenceData,
contentType: 'application/json; charset=utf-8',
beforeSend: function() {
startSpinner();
}
})
我不知道这是否是由于序列化模型。
鉴于您目前的问题,我们可能无法重现您的情况,因此您需要添加更多代码和/或样本数据。 – Jeroen
阅读本文ko.toJSON(self);两次希望你会明白这个错误。 – Dnyanesh