0

我有以下 JSON:

[
       {
       "id":"78",
        "packaging": "0",
        "created_at": "2013-01-28 13:46:41",
        "updated_at": "2013-01-28 13:46:41",
        "Clients": {
                      "id": "6",
                      "Name": "Some Name",
                      "Address": "0000000",
                      "Email":"email@somedomain.com"
           }
     },
     {
       "id":"79",
        "packaging": "0",
        "created_at": "2013-01-28 13:46:41",
        "updated_at": "2013-01-28 13:46:41",
        "Clients": {
                      "id": "9",
                      "Name": "Some Other Name",
                      "Address": "0000001",
                      "Email":"email@someotherdomain.com"
           }
     }
]

我已经在 J​​sonlint.com 上验证了它是有效的 JSON。

我设法引用了未嵌套的数据,如下所示:

    {"sTitle":"Id","mData":"id"},
    {"sTitle":"Created At","mData":"created_at"},
    {"sTitle":"Updated At.","mData":"updated_at"},

现在我希望能够在数据表上引用客户名称。

我该如何使用mData

4

1 回答 1

2

试试这个-

{"sTitle":"Client ID","mData":"Clients.id"},
{"sTitle":"Client Name","mData":"Clients.Name"},
{"sTitle":"Client Address","mData":"Clients.Address"}
于 2013-05-06T06:24:12.563 回答