We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to show the active and outdated records in React Grid

Is it possible to have (permanent) filters criteria? For example, if I have a status field with active, inactive, and outdated; is it possible to have the grid ALWAYS show the active records even when the user has searched for outdated? In this case I would want it to show outdated AND active.



1 Reply 1 reply marked as answer

RR Rajapandi Ravi Syncfusion Team October 2, 2020 03:49 AM UTC

Hi Jesse, 

Greetings from syncfusion support 

We have analyzed your query and we could see that you like to show the Active records in grid and then you also like to display the outdated records. You can achieve your requirement by setting the initial filter in Grid. Please refer the below code example , sample, video demo and documentation for more information. 

 
export class Localbinding extends SampleBase { 
   filterOptions = {  //Initial filtering 
     type: 'Excel', 
     columns: [ 
      { field: 'Status', matchCase: false, 
        operator: 'startswith', predicate: 'and', value: 'Active' 
      } 
    ] 
  }; 
    render() { 
        return (<div className='control-pane'> 
                    <GridComponent dataSource={this.datas} allowFiltering={true} filterSettings={this.filterOptions} ref={g => this.grid = g} allowPaging={true} pageSettings={{ pageCount: 5 }}> 
                        <ColumnsDirective> 
                            <ColumnDirective field='OrderID' headerText='Order ID' width='120' textAlign="Right"/> 
          <ColumnDirective field='Status' headerText='Status' width='150'/> 
                        </ColumnsDirective> 
                        <Inject services={[Page, Filter]}/> 
                    </GridComponent> 
            </div>); 
   




Regards,
Rajapandi R 


Marked as answer
Loader.
Live Chat Icon For mobile
Up arrow icon