Load part of json in datatable

Hello,

I’m using Webix, AngularJS and Symfony2 (backend for API). This API gives me a link “/api/secure/cases” with json data like :

[
{
"id": 1, "sys_date": "1435183200", "received_on": "1435356000", "subject": { "id": 1, "sys_date": "1435220859", "name": "Complaint" }, "election": { "id": 1, "name": "Election 1", "sys_date": "1435220859" }, "related_cases_with_me": [ ], "legal_officer": { "id": 1, "username": "gentg", "email": "asd@example.com", "enabled": true, "sys_date": "1435220859", "name": "admin", "lastname": "admin", "date_created": "1435220859", "groups": [ { "id": 1, "name": "System Administrators", "roles": [ "ROLE_USER_CREATE", "ROLE_USER_EDIT", "ROLE_USER_DELETE", "ROLE_CATEGORY_CREATE", "ROLE_CATEGORY_EDIT", "ROLE_CATEGORY_DELETE", "ROLE_LOG_READ" ], "sys_date": "1435220859" } ], "deactivated": false }, "panel_members": [ ], "plaintiff_complainant": { "id": 1, "sys_date": "1435220859", "name": "Political Entity" }, "plaintiff_complainant_name": "Alush", "plaintiff_complainant_address": "asdasdasdasd", "plaintiff_complainant_municipality": { "id": 1, "sys_date": "1435220859", "name": "Prishtina" }, "decision": { "id": 2, "sys_date": "1433973600", "decision_number": "1\\/1\\/2015", "decision_type": { "id": 1, "sys_date": "1435223145", "name": "Partially Decided" }, "legal_grounds": "asdasd", "fine": [ ], "banned_from_serving_e_m_b": [ ], "banned_from_standing_candidate": [ ], "remedial_action": [ ], "supreme_court_case_nr": "123", "sc_decision_type": { "id": 1, "sys_date": "1435223145", "name": "Partially Decided" }, "decision_date": "asdasdasdas", "sc_legal_grounds": "asdasdsad" }, "contact_name": "asdasd", "contact_phone_number": "123123", "plaintiff_complainant_email": "asdasd@example.com", "offender_municipality": { "id": 1, "sys_date": "1435220859", "name": "Prishtina" }, "offender": { "id": 1, "sys_date": "1435220859", "name": "Political Entity" }, "offender_name": "asdasd", "offender_address": "asdasdasd", "number_of_attached_documents": 3, "phase_electoral_proccess": { "id": 1, "sys_date": "1435220859", "name": "Pre-election period" }, "documents": [ ], "natures_of_content": [ ], "correspondences": [ { "id": 1, "sys_date": "1434060000", "name": "asdasd", "address": "asdasdasd", "direction_of_correpondence": { "id": 3, "sys_date": "1435223145", "name": "Incomming" }, "subject_matter": { "id": 7, "sys_date": "1435223145", "name": "Explanation from alleged perpetrators" }, "annexes_nr": 2, "annexes_type": "asdasdasd", "date_and_time": "1434578400", "date_of_expiration": "1434751200", "date_sent": "1434751200", "decision_type": { "id": 2, "sys_date": "1435223145", "name": "Decided" }, "documents": [ ] } ]
}
]

My question is how can i access for example this part : “decision_type”: { “id”: 2, “sys_date”: “1435223145”, “name”: “Decided” } and show it in datable. Below is my datable part.

columns:[
{ id:“case_number”, header:“Case”, fillspace:true },

                ],

Thank you in advance

You can use

You can change the template

columns:[ { id:"case_number", template:"#obj[0].decision.decision_type.name#", header:"Case", fillspace:true },

or you can change how the data is loaded in the datatable and load only requred part of json data

var thedata = webix.ajax("/api/secure/cases").then(function(data){ 
  return data.json()[0].decision.decision_type;
});
webix.ui({ view:"datatable", data:thedata});

Thanks for fast and detailed answer maksim.

First solution will suit best for me, but when I’m using it throws me this error:
“Uncaught TypeError: Cannot read property ‘0’ of undefined”. Any idea ?

Actually I solved this.
Just by using map attribute:
columns:[ { id:“case_number”,map:"#decision.decision_type.name#" header:“Case”, fillspace:true },

Anyway thank you for your help