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
|
// custom filter predicates
|
||||||
if (this.filterProps && this.filterProps.length) {
|
if (this.filterProps && this.filterProps.length) {
|
||||||
for (const prop of this.filterProps) {
|
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) {
|
if (!!propertyAsString) {
|
||||||
const foundProp =
|
const foundProp =
|
||||||
|
@ -105,7 +105,7 @@ export class AgendaListComponent extends BaseListViewComponent<ViewItem> impleme
|
|||||||
/**
|
/**
|
||||||
* Define extra filter properties
|
* Define extra filter properties
|
||||||
*/
|
*/
|
||||||
public filterProps = ['itemNumber', 'comment'];
|
public filterProps = ['itemNumber', 'comment', 'getListTitle'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The usual constructor for components
|
* The usual constructor for components
|
||||||
@ -191,7 +191,7 @@ export class AgendaListComponent extends BaseListViewComponent<ViewItem> impleme
|
|||||||
if (this.isMultiSelect || !this.canManage) {
|
if (this.isMultiSelect || !this.canManage) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const dialogRef = this.dialog.open(ItemInfoDialogComponent, infoDialogSettings);
|
const dialogRef = this.dialog.open(ItemInfoDialogComponent, { ...infoDialogSettings, data: item });
|
||||||
|
|
||||||
dialogRef.afterClosed().subscribe(result => {
|
dialogRef.afterClosed().subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
|
Loading…
Reference in New Issue
Block a user