json format and display
json format and display
Hi
I'm a newer.
Now, I have a json data like this:
{"teacher":
[
{
"id":"1522",
"teachername":"Eric",
"subject_grade":{
"subject":[5],
"grade":[18,19]
},
"mastername":"slina"
}
]
}
can i make it display like this: http://www.treasurydirect.gov/instit/annceresult/press/preanre/2010/2010_26week.htm
that's to say,the "subject_grade" display in two rows,and others display in on rows.
thanks!
I'm a newer.
Now, I have a json data like this:
{"teacher":
[
{
"id":"1522",
"teachername":"Eric",
"subject_grade":{
"subject":[5],
"grade":[18,19]
},
"mastername":"slina"
}
]
}
can i make it display like this: http://www.treasurydirect.gov/instit/annceresult/press/preanre/2010/2010_26week.htm
that's to say,the "subject_grade" display in two rows,and others display in on rows.
thanks!
This discussion has been closed.
Replies
http://datatables.net/release-datatables/extras/FixedColumns/row_grouping_height.html
or
put small tables inside your cells: http://live.datatables.net/atuxud/edit#javascript,html,live
but,the json format in the example(http://datatables.net/release-datatables/extras/FixedColumns/row_grouping_height.html) is not same with mine.
I want to know how to parse mine json data.
[code]
{
"teacher":[
{
"id":"1522",
"teachername":"Eric",
"subject_grade": "518",
"mastername":"slina"
}
]
}
[/code]
It works well.
is this must be set in json data?? if I don't want to change the json data,how can i get the same result?
that's to say,can i call a function of datatables to achieve this goal?
thanks agian
i resolve it by using fnRender.like this:
[code]
"fnRender":function(oObj){
return''+ oObj.aData.subject_grade.grade + '' + oObj.aData.subject_grade.subject + '';
[/code]