DataGrid with angular2
Hello,
Have you any example to use DataGrid with angular-2 while passing settings in json from component not directly in the view ?
For example:
<dx-data-grid [dataSource]="projects"
[allowColumnResizing]="true"
[hoverStateEnabled]="false"
[allowColumnReordering]="true"
[searchPanel]="{visible: true}"
[paging]="{pageSize: 5}"
[pager]="{showInfo:true,showNavigationButtons:true,showPageSizeSelector:true}"
[rowAlternationEnabled]="true"
[selection]="{mode: 'none'}"
[editing]="{mode: 'form',allowUpdating: true,allowDeleting: true,allowAdding: true, texts:{addRow: 'Add a project'}}"
[export]="{enabled: true,fileName:'Projects',allowExportSelectedData: true}"
[groupPanel]="{visible: true}"
[filterRow]="{visible: true,applyFilter: 'auto'}"
[selection]="{mode: 'single'}">
</dx-data-grid>
How we can pass json objects from component to view? while in above example json objects are directly mentioned in view.
Regards, Ali
Hi,
You can find an example of complex property usage in our sample app. Please check how the chart's series property is bound in the app.component.html file and declared in the app.component.ts file.
@dxbykov Thanks for your prompt response. Please let me know If I want to call some function from json object component. In your given example there are only binding for properties. What if I want to use some function e.g. onCellClick for dxDataGrid. How we can achieve this in Component of TypeScript? Regards, Ali
You can find an example in the comment I've recently posted. Just replace the onCellPrepared entry with the onCellClick one.