Hi,
I have the following source:
var data =
[{
“Employee”: “John Doe”,
“JobCode”:
[
{ “Id”: 1, “Code”: “A” },
{ “Id”: 2, “Code”: “B” }
]
},
{
“Employee”: “Toto”,
“JobCode”:
[
{ “Id”: 3, “Code”: “C” },
{ “Id”: 4, “Code”: “D” }
]
}];
var source = {
datatype: ‘json’,
mapChar: ‘>’,
localdata: data,
datafields:
[
{ name: ‘Employee’, map: ‘Employee’ },
{ name: ‘JobCode’, type: ‘array’ },
{ name: ‘CodeName’, map: ‘JobCode>Code’ }
]
};
var dataAdapter = new $.jqx.dataAdapter(source);
$(“#jqxgrid”).jqxGrid({
source: dataAdapter,
columns:
[
{ text: ‘Employee Name’, datafield: ‘Employee’, width: 200 },
{ text: ‘Job Code A’, datafield: ‘CodeName’, width: 200 }
]
});
How can I access to the Code field in such way to display in the grid the Code beside the employee name?
How to handle a field in inner array?
Thanks.