I would like to place a button with popup menu next to the global search input of a table:
Code: Select all
<div class="card">
<p-table #customertable styleClass="p-datatable-users p-datatable-gridlines p-datatable-striped p-datatable-sm">
<ng-template pTemplate="caption">
<div class="p-d-flex p-jc-between">
<!-- <div class="p-d-flex p-flex-column p-flex-md-row p-jc-md-between table-header"> -->
<div>
Users
</div>
<div>
<p-menu #menu [popup]="true" [model]="userMenuItems" [style]="{'width':'250px'}"></p-menu>
<button type="button" pButton icon="pi pi-chevron-down" class="p-mr-2" label="Options" (click)="menu.toggle($event)" style="width:auto"></button>
<span class="p-input-icon-left">
<i class="pi pi-search"></i>
<input pInputText type="text" (input)="customertable.filterGlobal($event.target.value, 'contains')" placeholder="Global Search"/>
</span>
</div>
</div>
</ng-template>
</p-table>
</div>
When I place the button outside the table the popup position is as expected below the button.
How can I achieve this inside the table "caption" template?
Thanks in advance