I am having trouble figuring out the solution for my angular project that uses prime ng. I am trying to do column search on rows of dropdown values.
If I want to find all values that are 'Jan', no data is found. However, if I search for '1' it can find all the January values. Looks like it searches for the value but not the label. How can I search for it using the label instead?
Here is the code:
**HTML:**
<p-table #tt [value]="data" ....>
<input pInputText type="text" class="colmsearch"
placeholder="Search"
(input)="tt.filter($event.target.value, 'month', 'contains')">
.
.
.
<p-dropdown formControlName="month" class="dropdownInput" *ngSwitchCase="'month'"
[options]="monthLabels"></p-dropdown>
</p-table>
**TS:**
this.data = [
{id: 03, name: 'First', month: 1},
{id: 04, name: 'Second', month: 2},
{id: 05, name: 'Third', month: 1},
.
.
{id: 07, name: 'Fourth', month: 3}
];
this.monthLabels = [
{label: "Jan", value: 1},
{label: "Feb", value: 2},
{label: "Mar", value: 3},
.
.
{label: "Dec", value: 12}
];