:드롭 다운 선택에 따라 중첩 된 배열을 얻고하게 그것을 관찰
논리는 다음입니다 : 사용자가 선택한 형식에 따라, 모든 섹션이 양식에 관한 취득 . 예 : 사용자가 이름이 'T-01'인 양식을 선택하면 섹션 배열에이 양식과 관련된 모든 섹션이 채워 져야합니다. 그리고 각 섹션은 추가 계산을 위해 관찰 가능해야합니다. 섹션 모델 여기
function Form(name, title, max, total, sections) {
this.Name = ko.observable(name);
this.Title = ko.observable(title);
this.MAX = ko.observable(max);
this.Total = ko.observable(total);
this.Sections = ko.observableArray(sections);
this.addSection = function() {
this.Sections.push(new Section());
}.bind(this);
}
var FormOptions = ko.observableArray(['T-01', 'T-02', 'T-03']);
: 그리고 여기
내 양식 모델입니다function Section(section, criteria, is, cs, nc, fc, totalInitialScores, totalFinalScores) {
this.Section = ko.observable(section);
this.Criteria = ko.observable(criteria);
this.IS = ko.observable(is);
this.CS = ko.observable(cs);
this.NC = ko.observable(nc);
this.FC = ko.observable(fc);
this.TotalInitialScores = ko.observable(totalInitialScores);
this.TotalFinalScores = ko.observable(totalFinalScores);
}
내가 루트 수준에서 몇 가지 모델을 가지고,하지만 난 확실하지, 여기에 포함되지 않습니다 필요한 경우.