Closed camberos closed 7 years ago
You need to use prop
instead of name
.
Just being caught by that having the underscore in the json prop. Why it is like that? @amcdnl could you provide some more details?
In my case I had just simple tamplate:
<ngx-datatable
class="material expandable"
[rows]="rows"
[columnMode]="'force'"
[columns]="columns"
[headerHeight]="50"
[footerHeight]="50"
[rowHeight]="'auto'"
[limit]="10"
[selectionType]="'single'">
</ngx-datatable>
and columns defined like that:
columns = [
{ name: 'id' },
{ name: 'system_id' }, //has to use `prop` instead of `name` to make it display in the datatable
{ name: 'state' },
{ name: 'inactive' }
];
Current behavior At the moment I am trying to populate the data table from a GET result, the objects are ok, as shown in the image below.
Once I add a third column with an underscore in the key, is where it gets ugly. As shown in the screenshot. For example the value group_id
This is the output, showing the missing column.
Expected behavior The expected behaviour should be as simple as shown in the code. Add a datatable-column with some basic parameters and should work, unless I am missing something in the configuration.
Angular version: 2.2.3
Browser: Chrome Version 54.0.2840.98 (64-bit)
Language: [all | TypeScript X.X | ES6/7 | ES5]