EasyUI Forum
May 05, 2024, 09:16:22 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: grid filters affecting other grids  (Read 4444 times)
chrwei
Full Member
***
Posts: 219


View Profile Email
« on: October 09, 2019, 07:30:20 AM »

I'm experiencing an issue when using multiple grid where a filter on one grid is affecting another grid, even if that other grid does not have "filterable" property set, and even if I navigate to another route.  problem is, these other grid have no indication that a filter is applied and no way to clear it. besides reloading the page.

I'm simply putting the "filterable" property on a grid, then in one column I have a LinkButton that opens a Dialog which has a simple grid with completely different data in it. that simple grid is also having the first grid's filter applied, which of course matches nothing.

am i doing something incorrectly with having multiple grids?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: October 09, 2019, 08:06:58 PM »

This is the simple way to get the filtered data and bind on the other grid.
1. Listen to the 'onFilterChange' event and then get the filtered data.
2. Bind this data on the other grid.
Code:
<DataGrid 
  ref={ref=>this.dg=ref}
  style={{ height: 250 }}
  filterable
  data={this.state.data}
  onFilterChange={this.handleFilterChange.bind(this)}
>
Code:
  handleFilterChange(filterRules){
    this.setState({filterRules})
    this.setState({otherData: this.dg.filteredData})
  }
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #2 on: October 11, 2019, 12:55:30 PM »

I think you misunderstand. 

the filter itself is applying to other grids.  I don't want it to.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!