DTColumnbuilder nested object?
I hope this is the right place to ask this question but i simply don't know if it's possible to display a specific nested object with angular datatables.
I'm doing a part catalog with server side processing, 1 part can have many part numbers, so what i want to do is to have 2 columns;
1 displays the description, and the other displays the first part number
Let me show you my response;

This is how i did my server request, this one gives me the entire object of parts and the parts number associated with that part

And this is how i thought i could do the other column that displays the first part number, but it seems like is not working

My question is, is there a way to get the first value of a nested object through DTColumnbuilder? or is there another way i can aproach this problem?
Sorry if this is not the place to ask such things but i didnt find anything about this on angular datatables API documentation. Cheers.
Sorry, any ideas? Is there a way to make a column that displays the first element of a nested object through dtcolumnbuilder?
Your data is something like this:
{
"data": [{
"description": "0 part",
"id": 29,
"parts_number": [{
"id": 40,
"part_number": 29,
}]
}]
}
If you want to access to the part_number value, then you need to define your columns like this:
$scope.dtColumns = [
DTColumnBuilder.newColumn('parts_number[0]part_number').withTitle('Part number'),
DTColumnBuilder.newColumn('description').withTitle('Description')
];
Thanks so much for looking at my question
Unfortunately it's not working (for now), i did as you say and the moment i enter to the page i get this message:

After pressing 'Ok' the rest of the table loads up normally except for the new column, which displays nothing:
code:
$scope.dtColumns = [
DTColumnBuilder.newColumn('description').withTitle('Part description'),
DTColumnBuilder.newColumn('parts_number[0]part_number').withTitle('1st part number'),
DTColumnBuilder.newColumn(null).withTitle('Actions').notSortable().renderWith(actionsHtml)
];
BUT if i don't specify which value i want to display i got something like this:

code:
$scope.dtColumns = [
DTColumnBuilder.newColumn('description').withTitle('Part description'),
DTColumnBuilder.newColumn('parts_number[0]').withTitle('1st part number'),
DTColumnBuilder.newColumn(null).withTitle('Actions').notSortable().renderWith(actionsHtml)
];
I don't know what's causing this, maybe i'm overlooking something?
My bad, it should be parts_number[0].part_number.
Welp i found a workaround by just using points "." like this =
$scope.dtColumns = [ DTColumnBuilder.newColumn('parts_number.0.part_number').withTitle('1st part number'), ];
And it works too if i do it like you just have said. Thanks a lot for your help.