删除Knockout Js .Map数组中的嵌套项

时间:2013-06-28 20:52:30

标签: javascript knockout.js

我有这个ko模型,我使用ko.mapping.fromJSON()来填充下面的这个json。我正在使用模板遍历json,我想知道如何能够删除特定的ProceduresToModalityList节点中的项目。任何见解或帮助都将非常感谢,谢谢!

function ModalityListViewModel() {
        var self = this;
        self.listModalities = ko.observable();

}


[{
    "Id": 1,
    "PayerID": 5,
    "UserID": 0,
    "Name": "ciby1",
    "Description": "blah",
    "UserCreated": "2",
    "UserModified": "2",
    "DateCreated": "2013-06-20T22:42:47",
    "DateModified": null,
    "ProceduresToModalityList": [{
        "Id": 10,
        "UserID": 0,
        "ModalityID": 1,
        "ModalityName": "ciby1",
        "ProcedureID": 1000,
        "ProcedureCode": "15157",
        "ProcedureDescription": "Tissue cultured skin autograft face scalp eyelids mouth neck ears orbits genitalia hands feet and/or multiple digits each additional 100 sq cm or each additional 1% of body area of infants and children or part thereof (List separately i",
        "UserCreated": "cibydev1",
        "UserModified": "",
        "DateCreated": "2013-06-28T16:10:24",
        "DateModified": null,
        "ErrorMessage": ""
    }],
    "IsActive": true,
    "ErrorMessage": null
}, {
    "Id": 2,
    "PayerID": 5,
    "UserID": 0,
    "Name": "ciby2",
    "Description": "blah",
    "UserCreated": "2",
    "UserModified": "2",
    "DateCreated": "2013-06-20T22:52:37",
    "DateModified": null,
    "ProceduresToModalityList": [],
    "IsActive": true,
    "ErrorMessage": null
}, {
    "Id": 5,
    "PayerID": 5,
    "UserID": 0,
    "Name": "ciby3",
    "Description": "blah",
    "UserCreated": "cibydev1",
    "UserModified": "cibydev1",
    "DateCreated": "2013-06-20T22:59:07",
    "DateModified": null,
    "ProceduresToModalityList": [],
    "IsActive": true,
    "ErrorMessage": null
}]

0 个答案:

没有答案