0
I’m using Picklist on an Angular 7 app. In Picklist, I need to search more than one field displayed in the container.
On their website (Primeng) there is an example: Picklisttutorial On the tag, there’s a field called filterBy="Brand" where I place the field to be filtered, but need to inform more fields in this part.
I tried to do so filterBy="Brand, year, color", but only takes the first field to search.
Code of the Component.html.ts
<p-pickList [source]="sourceCars" [target]="targetCars" sourceHeader="Available" targetHeader="Selected" [responsive]="true" filterBy="brand"
dragdrop="true" sourceFilterPlaceholder="Search by brand" targetFilterPlaceholder="Search by brand" [sourceStyle]="{'height':'300px'}" [targetStyle]="{'height':'300px'}">
<ng-template let-car pTemplate="item">
<div class="ui-helper-clearfix">
<img src="assets/showcase/images/demo/car/{{car.brand}}.png" style="display:inline-block;margin:2px 0 2px 2px" width="48">
<div style="font-size:14px;float:right;margin:15px 5px 0 0">{{car.brand}} - {{car.year}} - {{car.color}}</div>
</div>
</ng-template>
</p-pickList>
Code Component.ts
export class PickListDemo {
sourceCars: Car[];
targetCars: Car[];
constructor(private carService: CarService) { }
ngOnInit() {
this.carService.getCarsSmall().then(cars => this.sourceCars = cars);
this.targetCars = [];
}
}
Put the full code.
– Isaías de Lima Coelho
I edited the question by adding the code there @Isaíasdelimacoelho
– Edward Ramos
I looked in their repository and really bugged, https://github.com/primefaces/primeng/issues/7121 you can follow this site and see if it has any time. but unfortunately it will not be with this Component that will achieve.
– Isaías de Lima Coelho
@Isaíasdelimacoelho, I removed the spaces I had, and it worked the filter! Eduardovargas gave the solution.
– Edward Ramos