Merge pull request #4908 from GabrielInTheWorld/topicSearch
Adds the option to filter a list by function-values
This commit is contained in:
commit
7f600d4369
@ -331,7 +331,13 @@ export class ListViewTableComponent<V extends BaseViewModel, M extends BaseModel
|
||||
// custom filter predicates
|
||||
if (this.filterProps && this.filterProps.length) {
|
||||
for (const prop of this.filterProps) {
|
||||
const propertyAsString = '' + item[prop];
|
||||
let propertyAsString = '';
|
||||
// If the property is a function, call it.
|
||||
if (typeof item[prop] === 'function') {
|
||||
propertyAsString = '' + item[prop]();
|
||||
} else {
|
||||
propertyAsString = '' + item[prop];
|
||||
}
|
||||
|
||||
if (!!propertyAsString) {
|
||||
const foundProp =
|
||||
|
@ -105,7 +105,7 @@ export class AgendaListComponent extends BaseListViewComponent<ViewItem> impleme
|
||||
/**
|
||||
* Define extra filter properties
|
||||
*/
|
||||
public filterProps = ['itemNumber', 'comment'];
|
||||
public filterProps = ['itemNumber', 'comment', 'getListTitle'];
|
||||
|
||||
/**
|
||||
* The usual constructor for components
|
||||
@ -191,7 +191,7 @@ export class AgendaListComponent extends BaseListViewComponent<ViewItem> impleme
|
||||
if (this.isMultiSelect || !this.canManage) {
|
||||
return;
|
||||
}
|
||||
const dialogRef = this.dialog.open(ItemInfoDialogComponent, infoDialogSettings);
|
||||
const dialogRef = this.dialog.open(ItemInfoDialogComponent, { ...infoDialogSettings, data: item });
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if (result) {
|
||||
|
Loading…
Reference in New Issue
Block a user