diff --git a/src/views/datatable/DataTableLazyDemo.vue b/src/views/datatable/DataTableLazyDemo.vue
index e0a4e379b..39f0d81de 100755
--- a/src/views/datatable/DataTableLazyDemo.vue
+++ b/src/views/datatable/DataTableLazyDemo.vue
@@ -46,26 +46,27 @@
-<DataTable :value="customers" :lazy="true" :paginator="true" :rows="10" :filters="filters" ref="dt"
- :totalRecords="totalRecords" :loading="loading" @page="onPage($event)" @sort="onSort($event)">
- <Column field="name" header="Name" filterMatchMode="startsWith" ref="name" :sortable="true">
- <template #filter>
- <InputText type="text" v-model="filters['name']['value']" @keydown.enter="onFilter($event)" class="p-column-filter" placeholder="Search by name"/>
+<DataTable :value="customers" :lazy="true" :paginator="true" :rows="10" v-model:filters="filters" ref="dt"
+ :totalRecords="totalRecords" :loading="loading" @page="onPage($event)" @sort="onSort($event)" filterDisplay="row"
+ :globalFilterFields="['name','country.name', 'company', 'representative.name']">
+ <Column field="name" header="Name" filterMatchMode="startsWith" ref="name" :sortable="true">
+ <template #filter="{filterModel,filterCallback}">
+ <InputText type="text" v-model="filterModel.value" @keydown.enter="filterCallback()" class="p-column-filter" placeholder="Search by name"/>
</template>
</Column>
<Column field="country.name" header="Country" filterField="country.name" filterMatchMode="contains" ref="country.name" :sortable="true">
- <template #filter>
- <InputText type="text" v-model="filters['country.name']['value']" @keydown.enter="onFilter($event)" class="p-column-filter" placeholder="Search by country"/>
+ <template #filter="{filterModel,filterCallback}">
+ <InputText type="text" v-model="filterModel.value" @keydown.enter="filterCallback()" class="p-column-filter" placeholder="Search by country"/>
</template>
</Column>
<Column field="company" header="Company" filterMatchMode="contains" ref="company" :sortable="true">
- <template #filter>
- <InputText type="text" v-model="filters['company']['value']" @keydown.enter="onFilter($event)" class="p-column-filter" placeholder="Search by company"/>
+ <template #filter="{filterModel,filterCallback}">
+ <InputText type="text" v-model="filterModel.value" @keydown.enter="filterCallback()" class="p-column-filter" placeholder="Search by company"/>
</template>
</Column>
<Column field="representative.name" header="Representative" filterField="representative.name" ref="representative.name" :sortable="true">
- <template #filter>
- <InputText type="text" v-model="filters['representative.name']['value']" @keydown.enter="onFilter($event)" class="p-column-filter" placeholder="Search by representative"/>
+ <template #filter="{filterModel,filterCallback}">
+ <InputText type="text" v-model="filterModel.value" @keydown.enter="filterCallback()" class="p-column-filter" placeholder="Search by representative"/>
</template>
</Column>
</DataTable>
@@ -184,26 +185,27 @@ export default {
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
@@ -216,6 +218,11 @@ export default {
import CustomerService from '../service/CustomerService';
export default {
+ watch: {
+ filters() {
+ this.onFilter();
+ }
+ },
data() {
return {
loading: false,