Joined table JSON data looks partially duplicated. Is that needed? (and related questions)

Joined table JSON data looks partially duplicated. Is that needed? (and related questions)

burncharburnchar Posts: 118Questions: 12Answers: 0
edited September 2012 in Editor
I just got back to my DataTables editor project and still have some work to do to figure out how the JSON for joined tables is made and especially used.

Is duplication of these rows required?

(two copies of "Printer" value)
[code]
"access":[
{
"value":"1",
"0":"1",
"label":"Printer",
"1":"Printer"
}
]
[/code]

Or here:


("Printer" and a numeric id, same as above)
Should mData be used to read from the above object here instead of repeating it?
[code]
{
"DT_RowId": "row_8",
"first_name": "Bryar",
"last_name": "Long",
"dept": {
"id": "1",
"name": "IT"
},
"access": [
{
"id": "1",
"name": "Printer"
}
],
"extra": { }
},
[/code]

I find duplication inherently confusing. What happens if "label":"Printer" is changed to "label":"snarfblat", for example? There are still other copies with the text, "Printer". Where is the "label" key from the "access" object (the one at the top of this post) used?
Sorry, I'm having a really hard time with this. As I mentioned in a previous post, I don't use PHP so have to generate the JSON manually.
This discussion has been closed.