Hi Team,
I am using the below code to implement the custom filter template but getting the errors.
export default class App extends React.Component<{}, {}>{
public grid: Grid | null;
public fields: object = { text: 'CustomerID', value: 'CustomerID' };
public filterOptions: FilterSettingsModel = {
type: 'Excel'
};
public dropdata: string[] = DataUtil.distinct(data, 'CustomerID') as string[];
public filterTemplate(props:any): any {
const val = isNullOrUndefined(props.CustomerID) ? '' : props.CustomerID;
return (<DropDownListComponent id='CustomerID'
fields={this.fields} dataSource={this.dropdata} /> );
}
public render() {
this.filterTemplate = this.filterTemplate.bind(this);
return <GridComponent ref={g => this.grid = g} dataSource={data} filterSettings={this.filterOptions} allowFiltering={true} >
<ColumnsDirective>
<ColumnDirective field='OrderID' headerText='Order ID' width='140' textAlign="Right"/>
<ColumnDirective field='EmployeeID' headerText='EmployeeID' width='140' textAlign="Right"/>
<ColumnDirective field='CustomerID' filterTemplate={this.filterTemplate} width='140'/>
<ColumnDirective field='ShipName' width='170' textAlign="Right"/>
</ColumnsDirective>
<Inject services={[Filter]} />
</GridComponent>
}
};