Object of objects server response to datatable
Object of objects server response to datatable
Hello i'm having
[code]{
"name": "Ürün1",
"description": null,
"link": "www.google.com",
"picture": "",
"currencyId": {
"description": "Türk Lirası",
"symbol": "TL",
"tableName": "currency",
"id": "1"
},
"price": "10",
"companyId": {
"description": "",
"symbol": null,
"tableName": "company",
"id": "1",
"name": "Ikea",
"link": "",
"logo": "",
"order": "0",
"active": "0"
},
"active": "1",
"width": "10",
"height": "10",
"order": "1",
"tableName": "product",
"id": "1",
"desription": "Ürün açıklaması"
}[/code]
server response. And i'd like to get currencyId's description field, and name field for companyId How should i define aoColumns?? Or is this possible?
Thank you
[code]{
"name": "Ürün1",
"description": null,
"link": "www.google.com",
"picture": "",
"currencyId": {
"description": "Türk Lirası",
"symbol": "TL",
"tableName": "currency",
"id": "1"
},
"price": "10",
"companyId": {
"description": "",
"symbol": null,
"tableName": "company",
"id": "1",
"name": "Ikea",
"link": "",
"logo": "",
"order": "0",
"active": "0"
},
"active": "1",
"width": "10",
"height": "10",
"order": "1",
"tableName": "product",
"id": "1",
"desription": "Ürün açıklaması"
}[/code]
server response. And i'd like to get currencyId's description field, and name field for companyId How should i define aoColumns?? Or is this possible?
Thank you
This discussion has been closed.
Replies
Allan
In configuration of datatables i used [code]"aoColumns" : [
{ "mData" : "picture" },
{ "mData" : "name" },
{ "mData" : "description" },
{ "mData" : "link" },
{ "mData" : "price" },
{ "mData" : "companyId.name" }, //ACCESSING OBJECT OF OBJECT
{ "mData" : "name" },
{ "mData" : "active" } ,
{ "mData" : null }
],[/code]
and it resolved my issue by using the row commented above.. Thanks for your consideration.