{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "grid-default-filtering",
  "framework": "react",
  "type": "registry:component",
  "component": "Grid",
  "variant": "default-filtering",
  "dependencies": [
    "@syncfusion/ej2-react-grids",
    "@syncfusion/ej2-react-dropdowns",
    "@syncfusion/ej2-react-buttons"
  ],
  "description": "Data grid demonstrating the default filter menu and its paired UI control options.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/react/llms.txt",
    "skillPack": "syncfusion/react-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/react/ts/grid-default-filtering.md"
  },
  "files": [
    {
      "target": "src/components/grid-default-filtering/Grid.tsx",
      "content": "/* eslint-disable @typescript-eslint/no-this-alias */\nimport { DropDownListComponent } from '@syncfusion/ej2-react-dropdowns';\nimport { GridComponent, ColumnsDirective, ColumnDirective, Page, Filter, Inject, Sort } from '@syncfusion/ej2-react-grids';\nimport { categoryData } from '../datasource/grid-data';\n\nfunction Filtering() {\n    let gridInstance: GridComponent;\n    const filData: { [key: string]: Object }[] = [\n        { id: '1', category: 'All' },\n        { id: '2', category: 'Beverages' },\n        { id: '3', category: 'Condiments' },\n        { id: '4', category: 'Confections' },\n        { id: '5', category: 'Dairy Products' },\n        { id: '6', category: 'Grains/Cereals' },\n        { id: '7', category: 'Meat/Poultry' },\n        { id: '8', category: 'Produce' },\n        { id: '9', category: 'Seafood' }\n    ];\n    const fields: Object = { text: 'category', value: 'id' };\n    function onChange(sel: { itemData: { item: number, category: string } }): void {\n        if (sel.itemData.category === 'All') {\n            gridInstance.clearFiltering();\n        } else {\n            gridInstance.filterByColumn('CategoryName', 'equal', sel.itemData.category);\n        }\n    }\n\n    return (\n        <div className='control-pane'>\n            <div className='col-lg-9 control-section'>\n                <div style={{ padding: '14px 0' }}>\n                    <div className=\"select-wrap\">\n                        {/* @ts-ignore */}\n                        <DropDownListComponent id=\"ddlelement\" dataSource={filData} fields={fields} change={onChange.bind(this as any)} placeholder=\"Select category to filter\" width=\"200px\" />\n                    </div>\n                </div>\n                <GridComponent dataSource={categoryData} allowPaging={true} allowSorting={true} ref={(grid: any) => gridInstance = grid} pageSettings={{ pageSize: 10, pageCount: 5 }} allowFiltering={true}>\n                    <ColumnsDirective>\n                        <ColumnDirective field='CategoryName' headerText='Category Name' width='150'></ColumnDirective>\n                        <ColumnDirective field='ProductName' headerText='Product Name' width='150'></ColumnDirective>\n                        <ColumnDirective field='UnitsInStock' headerText='Units In Stock' width='150' textAlign='Right'></ColumnDirective>\n                        <ColumnDirective field='Discontinued' headerText='Discontinued' width='150' textAlign='Center' displayAsCheckBox={true} type='boolean' ></ColumnDirective>\n                    </ColumnsDirective>\n                    <Inject services={[Filter, Page, Sort]} />\n                </GridComponent>\n            </div>\n\n        </div>\n    )\n}\nexport default Filtering;"
    }
  ]
}