How to get the filtered data of GridPanel?

  1. #1

    How to get the filtered data of GridPanel?

    I want to export the the filtered data of GridPanel.I used the getRowsValues method,but I dont like to select the rows because maybe there are many rows.Could you tell me other methods to get the data after filtering ?I used the local filter.
  2. #2
    Hi,

    There is the "filterRecord" option.
    grid.getRowsValues({
        filterRecord : function (record) {
            return true/false; // false to exclude a record
        }
    })
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    There is the "filterRecord" option.
    grid.getRowsValues({
        filterRecord : function (record) {
            return true/false; // false to exclude a record
        }
    })
    I useed it ,but it doesn't work.Could you please give me a small example for that.
    Many thanks.
  4. #4
    Unfortunately, I have no such example and no time to prepare.

    Please demonstrate how are you trying?

    As well how do you filter a grid data?
  5. #5
    Quote Originally Posted by Daniil View Post
    Unfortunately, I have no such example and no time to prepare.

    Please demonstrate how are you trying?

    As well how do you filter a grid data?
    I was use it like this in a button's ExtraParams.

    <ExtraParams>
    <ext:Parameter Name="Grid1" Value="Ext.encode(#{grid}.getRowsValues({filterRecord : function (record) {return true;}}))" Mode="Raw" />
    </ExtraParams>
    And I filter my grid data use like this.

    <ext:GridFilters runat="server" ID="GridFilters1" Local="true" FiltersText="Filter">
                            <Filters>
                                <ext:StringFilter DataIndex="StatementNum" />
                                <ext:StringFilter DataIndex="CompanyName" />
                                <ext:StringFilter DataIndex="Area" />
                                <ext:StringFilter DataIndex="StartPlace" />
                                <ext:StringFilter DataIndex="EndPlace" />
                                <ext:StringFilter DataIndex="VehicleNum" />
                                <ext:StringFilter DataIndex="DriverName" />
                                <ext:DateFilter DataIndex="PickupDate" AfterText=">" BeforeText="<" OnText="=">
                                <DatePickerOptions Format="yyyy-MM-dd"></DatePickerOptions>
                                </ext:DateFilter>
                                
                            </Filters>
                        </ext:GridFilters>

    And I want to get the data after filtering in the codebehind.
    Last edited by Daniil; Mar 20, 2012 at 10:57 AM. Reason: Please use [CODE] tags
  6. #6
    thanks~~I have found the solution in the other thread.
    I use this:
    GridPanel1.getRowsValues({
        filterRecord : GridPanel1.filters.getRecordFilter()
    });
    and it works.
    Many thanks.
    Last edited by Daniil; Mar 20, 2012 at 10:56 AM. Reason: Please use [CODE] tags

Similar Threads

  1. [CLOSED] Get Store's Filtered Records
    By Juls in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Oct 04, 2011, 7:42 AM
  2. Replies: 0
    Last Post: Jul 02, 2011, 9:14 PM
  3. How to retrieve filtered data from grid
    By chezinho in forum 1.x Help
    Replies: 0
    Last Post: Jan 07, 2011, 11:41 AM
  4. Selected row in filter after filtered
    By chezinho in forum 1.x Help
    Replies: 0
    Last Post: Jan 04, 2011, 2:27 PM
  5. [CLOSED] [1.0] Adding new rows to filtered Grid
    By danielg in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Dec 22, 2009, 3:57 AM

Posting Permissions