0

I have the following 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 protected]"
           }
     },
     {
       "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 protected]"
           }
     }
]

I have verified that it is valid JSON on Jsonlint.com.

I have managed to reference the unnested data as below:

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

Now I want to be able to reference the Clients' Name on datatables.

How do I do this using mData?

3
  • 3
    did you trying using the conventional "Clients.Name"? Commented May 6, 2013 at 6:19
  • Yes dot notation.Trying that right away. Thanks. Commented May 6, 2013 at 6:22
  • The conventional "Clients.Name" works. Thank you man. Commented May 6, 2013 at 6:25

1 Answer 1

2

Try this-

{"sTitle":"Client ID","mData":"Clients.id"},
{"sTitle":"Client Name","mData":"Clients.Name"},
{"sTitle":"Client Address","mData":"Clients.Address"}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.