[CLOSED] How to select a top GridPanel row when GridFilter is updated?

  1. #1

    [CLOSED] How to select a top GridPanel row when GridFilter is updated?

    Hi,

    I'd like to have the first row of the GridPanel selected when the user updates the GridFilter on the client. This row has to be visible based on the filter criteria. If no rows become visible as a result of filter manipulation or store contents changes, no row should be selected. Please advise how to approach this scenario. I've been fiddling with ListFilter listeners a bit but not sure at this point how to identify filtered visible records in the GridView. If you need more information or if the requirement isn't clear, let me know kindly.
    Last edited by Baidaly; Apr 07, 2013 at 3:27 AM. Reason: [CLOSED]
  2. #2
    I seem to be making some progress here with timely hints from http://forums.ext.net/showthread.php...a-of-GridPanel

                    <View>
                        <ext:GridView ID="GridView1" runat="server">
                            <Listeners>
                                <BeforeRefresh Handler="
                                                        var values=GridPanel1.getRowsValues({
                                                            filterRecord : GridPanel1.filters.getRecordFilter()
                                                        }); 
    
                                                        if(values && values.length!=0)
                                                            GridPanel1.getSelectionModel().selectRow(0);" />
                            </Listeners>
                        </ext:GridView>
                    </View>
    I don't know how consistent or efficient this approach is but it's been working for me so far.
  3. #3
    Hello!

    I don't see anything inconsistent in this solution. I'm just curious what filtering do you use remote or local?
  4. #4
                    <Plugins>
                        <ext:GridFilters runat="server" ID="GridFilters1" Local="true">
                            <Filters>
                                <ext:ListFilter DataIndex="Id" StoreID="StoreFilterOptions" LabelField="Description">
                                    <Listeners>
                                        <Deactivate Handler="this.menu.items.each(function (item) {
                                                                item.setChecked(false);
                                                             });                                                        
                                                             " />
                                    </Listeners>
                                </ext:ListFilter>
                            </Filters>
                        </ext:GridFilters>
                    </Plugins>
    Local. I guess I also should check for existence of the length property of the getRowsValues() return object. It doesn't exist if no rows are returned. You can mark this thread as closed.

Similar Threads

  1. [CLOSED] GridPanel check row on select ( Multiple select)
    By FpNetWorth in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 12, 2013, 12:23 PM
  2. Replies: 2
    Last Post: Jan 16, 2012, 10:34 AM
  3. Replies: 2
    Last Post: Nov 11, 2011, 3:02 AM
  4. [CLOSED] Gridpanel's GRIDFILTER has an error on Datepicker
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 31, 2011, 7:31 AM
  5. [CLOSED] Reload the gridpanel after using gridfilter, the data lost
    By csssi_coolite in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 07, 2011, 11:27 AM

Tags for this Thread

Posting Permissions