Overriding default Sorting & Filtering logic for nested JSON as source.
- Langage dominant
- TypeScript
- Étoiles
- 1.6k
- Forks
- 867
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Hi,
I have nested JSON which i am passing to smart-table. I am setting my columns as follows:
```
this.gridSettings.columns['exceptionType'] = {
title: 'exceptionType',
editable: false
};
this.gridSettings.columns['exceptionDescription'] = {
title: 'exceptionDescription',
editable: false,
width: '20%',
};
this.gridSettings.columns['employment.employeeName'] = {
title: 'employeeName',
editable: false,
valuePrepareFunction: (cell: any, row: any) => row.employment.employeeName
};
this.gridSettings.columns['employment.postCode] = {
title: 'postCode',
editable: false,
valuePrepareFunction: (cell: any, row: any) => row.employment.postCode
};
```
The 'gridSettings' are normal settings for the ng2-smart-table defined as:
```
this.gridSettings = {
pager: {
display: true,
perPage: 50
},
mode: 'external',
reset: true,
actions: {
add: false,
position: 'right',
edit: false,
delete: false,
columnTitle: '',
},
noDataMessage: this._translate.instant('EventViewer.NoDataMsg'),
columns: {}
};
```
So the data binding is happening correctly. The issue is **sorting & filtering** for the nested objects.
I have also solved same by modifying code of **local.filter.js & local.sorter.js** inside the node_modules.
But changing those files will not be good idea.
So can anyone here give some good suggestions to **override the default sorting and filtering** for my purpose. @akveo-private @akveo-bot
Thanks for reading 👍
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.