将复杂的Json绑定到Html网格

时间:2016-01-28 10:42:12

标签: jquery json datatables kendo-grid

我试图将复杂的Json数组结构渲染为html网格。我试图使用Kendo UI网格和Datatables.js来绑定这个json数组,但我不太确定我应该如何绑定它。

这是我的Json。

{"data":[{"cemetry_record":{"info":{"application_id":"020.2009.00000004.001","cemetry_name":"Gore","cemetry_section":"Roman Catholic","service_type":"Burial","first_name":"david","middle_name":"charles","family_name":"smith","birth-date":"2000-01-01","date_of_death":"2015-01-01","service_date":"2015-01-01","last_modified_date":"2009-03-09T09:35:05+11:00","description":"Cemetry entry for david charles smith","Age":15,"Photos":"yes","lodgement_date":"2009-03-09T00:00:00+11:00","status":"deceased","formatted_application_number":"20.2009.4.1","contact_us_messsage":"contact us on 1234 for any details"}}}],"count":1,"pagination":{"previous":null,"next":null,"current":1,"per_page":10,"count":1,"pages":1},"error_list":null}

任何人都可以建议如何使用Kendo UI网格或数据表js或JPut插件绑定此数据?

更新 我使用Datatablesjs成功绑定了网格。还有一些问题。请参阅下面的代码。

$("#example").dataTable({
            "processing": true,
            "serverSide": true,
            "ajax": {
                "url": "@Url.Action("GetListJson", "Home")",               
            },
            columns: [
                { data: "cemetry_record.info.family_name" },
                { data: "cemetry_record.info.first_name" },
                { data: "cemetry_record.info.cemetry_name" },
                { data: "cemetry_record.info.cemetry_section" }
            ]
        });

"@Url.Action("GetListJson", "Home")"返回上面指定的json格式。

问题是数据表js期望具有特定名称的分页参数。有没有什么方法我可以指定哪个json属性用于分页类似我如何为列做?

0 个答案:

没有答案