问题描述
- knockout级联绑定下拉框问题
-
网页中,如何利用Knockout.js把如下结构的json绑定到两个下拉框中,显示是CategoryName,value是CategoryId,父级变,子级下拉框跟着变,请大侠直接告诉我解决方案好吗?[ { "ParentCategory": { "CategoryId": "a70b2eb0-483e-4bb7-a3da-4d80ab48d94f", "CategoryName": "类别A", }, "SubCategoryList": [ { "CategoryId": "2f8b3dbb-62c3-4955-8f4c-432d858164a0", "CategoryName": "A子类1", }, { "CategoryId": "a94064c9-6176-4f22-8564-c59505f7b431", "CategoryName": "A子类2", }, { "CategoryId": "b4b0b176-57a1-4f6c-9758-254eb3a30171", "CategoryName": "A子类3", } ] }, { "ParentCategory": { "CategoryId": "05163221-d053-4469-86e2-5725fc00d759", "CategoryName": "类别B", }, "SubCategoryList": [ ] } ]
时间: 2025-01-29 07:34:22