Use ID in search value and sort view
Allows the search value selector to search IDs as well. Show the ID in the Os-Sort-Tree
This commit is contained in:
parent
596b9516e6
commit
f9cab8162d
@ -133,13 +133,25 @@ export class SearchValueSelectorComponent implements OnDestroy {
|
|||||||
*/
|
*/
|
||||||
public getFilteredItems(): Selectable[] {
|
public getFilteredItems(): Selectable[] {
|
||||||
if (this.selectableItems) {
|
if (this.selectableItems) {
|
||||||
return this.selectableItems.filter(
|
return this.selectableItems.filter(item => {
|
||||||
item =>
|
const idString = '' + item.id;
|
||||||
|
const foundId =
|
||||||
|
idString
|
||||||
|
.trim()
|
||||||
|
.toLowerCase()
|
||||||
|
.indexOf(this.searchValue) !== -1;
|
||||||
|
|
||||||
|
if (foundId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
item
|
item
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.indexOf(this.searchValue) > -1
|
.indexOf(this.searchValue) > -1
|
||||||
);
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="section-three">
|
<div class="section-three">
|
||||||
<!-- Extra controls slot using implicit template references -->
|
<!-- Extra controls slot using implicit template references -->
|
||||||
|
<mat-basic-chip class="bluegrey" disableRipple matTooltip="{{ 'Sequantial number' | translate }}">
|
||||||
|
{{ item.id }}
|
||||||
|
</mat-basic-chip>
|
||||||
<ng-template [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="{ $implicit: item }"></ng-template>
|
<ng-template [ngTemplateOutlet]="templateRef" [ngTemplateOutletContext]="{ $implicit: item }"></ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div class="line" *cdkDragPreview>
|
<div class="line" *cdkDragPreview>
|
||||||
|
Loading…
Reference in New Issue
Block a user