我有JSON,其结构如下:
"id":1, "user_role":"ADMIN", "state":"ACTIVE", "address":{ "street":"test 59", "city":"City test", "post_number":"25050" },
我应该如何使用字段和模型中的设置将address.street的值传递到列中?
非常感谢您的任何建议。
如果要在单个列中显示所有值,请执行@RobinGiltner的建议。
如果要address在不同的列中显示每个成员,则可以执行以下操作:
address
var grid = $("#grid").kendoGrid({ dataSource: data, editable: true, columns : [ { field: "id", title: "#" }, { field: "user_role", title: "Role" }, { field: "address.street", title: "Street" }, { field: "address.city", title: "City" }, { field: "address.post_number", title: "Post#" } ] }).data("kendoGrid");
address.street