angulardevextremedevextreme-angular

DevExtrem Angular - DataGrid - How to use raw template with server side data processing


I am integrating the DevExtrem datagrid with Angular and Server side processing : https://js.devexpress.com/Documentation/Guide/Data_Binding/Specify_a_Data_Source/Custom_Data_Sources/

I would like to know if it is possible de have a custom raw template with server side processing ? The API will return an object "Currency" -> {"Symbol","Code"} but the actual data source display "Object" in the raw, so I need to tell to the datagrid to display in the row currency.code .


Solution

  • You can do it by using dxTemplate =

    <dx-data-grid
                    [dataSource]="customDataSource"
                    dataRowTemplate="dataRowTemplateName"
                >
                    <ng-container *dxTemplate="let test of 'dataRowTemplateName'">
                        <tr class="main-row">
                            <td>{{ test.data.id }}</td>
                            <td>{{ test.data.base_price }}</td>
                        </tr>
                    </ng-container>