这是 Kendo 数据源的有效 JSON 吗?

Is this a valid JSON for Kendo Datasource?

我无法在 kendo 树数据源中显示值。这对 Kendo TreeDataSourc 有效吗?JSON?

"[{\"fields\": {\"tgtWeight\": 0.0, \"hasChildnode\": true, \"parent\": null, \"currWeight\": 0.0, \"classificationNameNode\": null, \"SSM\": \"ssm4\", \"ext_model_id\": 4}, \"model\": \"equity.usersecurityselectionmodel\", \"pk\": 14}]"

这是Kendo的一面。

var dataSource = new kendo.data.TreeListDataSource({
        transport: {
            read: {
                url: "../getModelTargetWeights?id="+id,
                dataType: "json"
            }
        },
        schema: {
            model: {
                id: "pk",
                parentId: "parent",
                fields: {
                           fields: { field: "fields"},
                           tgtWeight: {field: "tgtWeight", type :"number"}
                }
                }
            }
    });

   $("#treeList").kendoTreeList({
        dataSource: dataSource,
        editable: true,
        height: 540

您的数据源架构应如下所示:

dataSource: {
    schema: {
        model: {
            id: "pk",
            parentId: "parent",
            fields: {
                parent: { nullable: true}
            }
        }
    }
}

并且 JSON 数组的每个元素应包含 hasChildren 个成员

更新: JSON 数组本身:

[{\"tgtWeight\": 0.0, \"hasChildren\": true, \"parent\": null, \"currWeight\": 0.0, \"classificationNameNode\": null, \"SSM\": \"ssm4\", \"ext_model_id\": 4, \"model\": \"equity.usersecurityselectionmodel\", \"pk\": 14}]

示例:http://dojo.telerik.com/uJoLo