primefaces / primeui

Rich set of javascript-css only widgets
http://www.primefaces.org/primeui
278 stars 125 forks source link

Lack of support of DataTable with nested objects in datasource #250

Open serralha85 opened 7 years ago

serralha85 commented 7 years ago

When using datatable

$('#gasTable').puidatatable({ paginator: { rows: 50 } , columns: [ { field: 'name', headerText: 'Name', sortable: true, filter: true, filterMatchMode: 'contains' }, { field: 'supplier.idSupplier', headerText: 'Name Supplier', sortable: true, filter: true, filterMatchMode: 'contains' } ] , sortMode: 'multiple' , selectionMode: 'single' , draggableColumns: false , responsive: true , datasource: function (callback) { $.ajax({ type: "GET", url: '/GasStation/GetGasStations', dataType: "json", context: this, success: function (response) { callback.call(this, response); } }); } });

Data source is [ {"idGasStation":31,"name":"185540. TAVEL","supplier":{"idSupplier":828,"idClient":0,"code":"","name":"VelocityFleet","local":null,"zipCode":null,"address":null,"MORLOCALE":null,"CODPOSTALE":null,"MORADAE":null,"country":null,"fiscalNumber":null,"contact":null,"phone":null,"fax":null,"email":null,"obs":null,"idCompany":0,"tableName":"ComCfgFornecedores"}}, {"idGasStation":60,"name":"A GUDIÑA","supplier":{"idSupplier":225,"idClient":0,"code":"","name":"ADS - BADAJOZ DIESEL SERVICE SL","local":null,"zipCode":null,"address":null,"MORLOCALE":null,"CODPOSTALE":null,"MORADAE":null,"country":null,"fiscalNumber":null,"contact":null,"phone":null,"fax":null,"email":null,"obs":null,"idCompany":0,"tableName":"ComCfgFornecedores"}} ]

I want to access supplier.idSupplier and it doesn't support it?