How to add Grid searching feature
Hi there,
May I know how to add search feature in VueJS sync fusion grid. I cannot see any demo.
But there is one for ReactJS.
https://ej2.syncfusion.com/react/demos/?_ga=2.241332295.49332759.1551689409-1997588708.1548674747#/material/grid/searching
could you please forward me a example for VueJs?
Thanks
Sundar
SIGN IN To post a reply.
3 Replies
PS
Pavithra Subramaniyam
Syncfusion Team
March 5, 2019 07:03 AM UTC
Hi sundar,
Greetings from Syncfusion.
You can add the default Searching feature by simply adding “Search” to the Grid toolbar items. Please refer to the below code example, Documentation link and sample link for more information.
[vue]
|
<template>
<div class="col-lg-12 control-section">
<div>
<ejs-grid :dataSource="data" :allowPaging="true" :pageSettings='pageSettings' :toolbar='toolbar'>
<e-columns>
<e-column field='CategoryName' headerText='Category Name' width='150'></e-column>
<e-column field='ProductName' headerText='Product Name' width='150'></e-column>
</e-columns>
</ejs-grid>
</div>
</div>
</template>
<script lang="ts">
import Vue from "vue";
import { GridPlugin, Page, Toolbar } from "@syncfusion/ej2-vue-grids";
import { categoryData } from "./data-source";
Vue.use(GridPlugin);
export default Vue.extend({
data: () => {
return {
data: categoryData,
pageSettings: { pageCount: 5 },
toolbar: ["Search"]
};
},
provide: {
grid: [Page, Toolbar]
}
});
</script> |
Also Grid has an option to search its content using the search() method with search key as the parameter.
Documentation: https://ej2.syncfusion.com/vue/documentation/grid/searching/
Please get back to us if you need any further assistance on this.
Regards,
Pavithra S.
SS
sundar sambandam
March 6, 2019 09:29 AM UTC
Thank you Pavithra,
I like to search in the existing record set. It looks like the demo is going to new data request with search criteria.
Is it possible filter or search the existing record set?
TS
Thavasianand Sankaranarayanan
Syncfusion Team
March 7, 2019 08:59 AM UTC
Hi Sundar,
Greetings from Syncfusion.
Based n your query we suspect that you want to do filtering with existing record set in Grid. We already have filtering feature with Grid and you can check the documentation/demo in the following link.
Please let us know if you need further assistance on this.
Regards,
Thavasianand S.
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
SS sundar sambandam
- Mar 4, 2019 12:43 PM UTC
- Mar 7, 2019 08:59 AM UTC