import { process } from "@progress/kendo-data-query"; import { GridColumn as Column, Grid, GridColumnMenuWrapper, GridToolbar, } from "@progress/kendo-react-grid"; import { Input } from "@progress/kendo-react-inputs"; import { Component, useEffect, useState } from "react"; import { getUserDetailsFromLocalStorage } from "../../service/app-services/reusableService"; import "../../styles/GPGrid.css"; import { DropDownCell } from "./DropDownCell"; import { CellRender, RowRender } from "./cellRender"; import columns from "./columns"; import { ColumnMenuCheckboxFilter, CustomColumnMenu } from "./customColumnMenu"; import { filterIcon } from "@progress/kendo-svg-icons"; // Setting grid edit configuration value const EDIT_FIELD = "inEdit"; // set initial pagination and sorting state (By default 'gpid' column is sorted in ascending order) let initialState = { sort: [ { field: "gpid", dir: "asc", }, ], skip: 0, take: 10, }; const matchStatusOptions = [ {}, ]; // extending component definition to handle custom column cell definitions, displaying long column values with ellipses and tooltips class ColumnCell extends Component { render() { let field = this.props.field; return ( {this.props.dataItem[field]} {this.props.children} ); } } // extending component definition to handle custom column header definitions, displaying long column values with ellipses and tooltips class ColumnHeader extends Component { render() { let title = this.props.title; this.props.columnMenuWrapperProps.filterable = false; return ( <> {this.props.title} {this.props.children} {/* https://www.telerik.com/forums/column-menu-doesn-t-work-in-custom-headers#5446983 Add custom column header menu icon manually */} ); } } export default function GPGrid({ }) { ... return ( <> {/* Hide columns from the column menu and enable the Grid to update the column menu accordingly - https://www.telerik.com/kendo-react-ui/components/grid/interactivity/column-menu/#toc-custom-components */} { {stateColumns.map((column, idx) => { return ( column.show && ( column.field === "matchStatus" ? ( matchStatusFilter === 1 ? ( ) : null ) : column.filter === "date" ? ( null ) : ( ) } /> ) ); })} {/* */} } ); }