0
私はノックアウトチェックボックスを持っており、チェックされている場合はfalseとして投稿されています。あなたが実際にノックアウトバインディング確認を使用していないノックアウトチェックボックスは常に偽
function Personnel(personnelId, firstName, middleName, lastName, primaryPhone, primaryPhoneExtension, secondaryPhone, secondaryPhoneExtension, fax, faxExtension, primaryEmail, secondaryEmail, postalAddress, city, state, zip, isVerified, isCorrect, postalMessage) {
var self = this;
self.personnelId = personnelId;
self.firstName = firstName;
self.middleName = middleName;
self.lastName = lastName;
self.primaryPhone = primaryPhone;
self.primaryPhoneExtension = primaryPhoneExtension;
self.secondaryPhone = secondaryPhone;
self.secondaryPhoneExtension = secondaryPhoneExtension;
self.fax = fax;
self.faxExtension = faxExtension;
self.primaryEmail = primaryEmail;
self.secondaryEmail = secondaryEmail;
self.postalAddress = postalAddress;
self.city = city;
self.state = state;
self.zip = zip;
self.isVerified = isVerified;
self.isCorrect = ko.observable(isCorrect);
self.postalMessage = postalMessage;
}
function KOViewModel() {
var self = this;
self.states = ko.observableArray();
var modelStates = mStates;
for (var i = 0; i < modelStates.length; i++) {
var state = modelStates[i];
self.states.push({
id: state.Value,
state: state.Text
});
}
self.managers = ko.observableArray();
var modelManagers = mManagers;
if (modelManagers.length === 0) {
self.managers.push(new Personnel(0, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""));
} else {
for (var x = 0; x < modelManagers.length; x++) {
var personnel = modelManagers[x];
self.managers.push(new Personnel(personnel.PersonnelId, personnel.FirstName, personnel.MiddleName, personnel.LastName, personnel.PrimaryPhone, personnel.PrimaryPhoneExtension, personnel.SecondaryPhone, personnel.SecondaryPhoneExtension, personnel.Fax, personnel.FaxExtension, personnel.PrimaryEmail, personnel.SecondaryEmail, personnel.PostalAddress, personnel.City, personnel.State, personnel.Zip5, personnel.IsVerified, personnel.IsCorrect, personnel.PostalMessage));
}
}
self.addPersonnel = function() {
self.managers.push(new Personnel(0, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""));
};
}
「Personnels [1] .IsCorrect:on'」として投稿されました。それが真実として投稿する方法はありますか? – Andrew
Nevermind、value = "true"を追加しました。ありがとうございました! – Andrew