EasyUI Forum
April 20, 2024, 12:44:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Possibility to get a DataGrid filter rows  (Read 5776 times)
Shatki
Newbie
*
Posts: 19


View Profile
« on: February 04, 2020, 02:36:53 PM »

Hello!
Is there a way to get all showed rows after applied a DataGrid filtering?
Like a sampled this:
https://www.jeasyui.com/demo-react/main/index.php?plugin=DataGrid&theme=metro-blue&dir=ltr&pitem=&sort=asc

Thanks!
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #1 on: February 05, 2020, 09:31:01 AM »

closest I've found is to use the onFilterChange event
Logged
Shatki
Newbie
*
Posts: 19


View Profile
« Reply #2 on: February 05, 2020, 10:41:01 PM »

closest I've found is to use the onFilterChange event
I tried it but to no avail

I did it like this:
Code:

constructor(props){
    super(props){
    ...
    }
    this.viewRows = [],
    this.viewRowsLength = 0
}

renderCode = ({ value, row, rowIndex }) =>{
        if (rowIndex < this.viewRowsLength) this.viewRows = this.viewRows.slice(0, rowIndex + 1);
        this.viewRows[rowIndex] = row;
        this.viewRowsLength = rowIndex;
        return value
    };

<DataGrid>
    ...
    <GridColumn
        render = { this.renderCode }
        field="code" title="Code" width="10%"/>
    ...
    ...
<DataGrid/>

But maybe possible to make it more simple?
« Last Edit: February 05, 2020, 10:43:55 PM by Shatki » Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #3 on: February 06, 2020, 07:30:43 AM »

what did you try?  I don't see any onFilterChange there.
Logged
Shatki
Newbie
*
Posts: 19


View Profile
« Reply #4 on: February 06, 2020, 09:41:22 AM »

what did you try?  I don't see any onFilterChange there.
Earlier I had shown only checked worked code

Event onFilterChange give us a filterRules what we changed. I don't understand how it will help us
Thanks
Logged
chrwei
Full Member
***
Posts: 219


View Profile Email
« Reply #5 on: February 10, 2020, 08:48:36 AM »

apply the filters yourself?

it would be great if that change event also gave a reference to the filtered list object, but it's not that hard to run it yourself
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!