GridPanel paging is removing filter

  1. #1

    GridPanel paging is removing filter

    I have problems trying to use a gridpanel with a pager and local gridfilters. If I apply a filterby to my gridPanel from javaScript function, my local filter work perfectly and i get what i need. But when i click next page arrow in paging toolBar, my local filter is no more active and the gridPanel will display the content of the entire store. So moving to the next page from toolBar paging will ignore/delete filters created locally in javaScript
  2. #2
    Hi

    I cannot reproduce it, i tried the following sample
    https://examples2.ext.net/Examples/G...l_Data_Paging/

    and apply the following filter in the console
    App.Store1.filterBy(function(r){return r.data.price > 50;})
    after that i navigate between grid pages and all works fine (filter is not ignored)
  3. #3
    Hi,

    Here is how i define my gridPanel

    @(Html.X().FormPanel()
                        
                    .Layout(LayoutType.Fit).Items(
                            Html.X().GridPanel().ID("ObservedGrid")
                            .EnableColumnResize(true)
                            .AllowDeselect(true)
                            .Split(true)
                            .AutoScroll(true)
                            .MultiSelect(true)
                            .EmptyText("No observed data at this time")
                            .MessageBusDirectEvents(
                            new MessageBusDirectEvent()
                            {
                                Name = "Stations.Select",
                                Action = "SetSelectedStations"
                                ,
                                ExtraParams = { new Ext.Net.Parameter() { Name = "selectedStationsIcao", Value = "data", Mode = ParameterMode.Raw } }
                        
                            }
                           )   
                            .Store(Html.X().Store().ID("ObservedStore")
                                                             .PageSize(15)
                                                         .DataSource(Model)
                                                    .Model(Html.X().Model()
                                                                    .Fields(
                                                                    ....
                                                                Html.X().ModelField().Name("id"),
                                                                Html.X().ModelField().Name("name"),
                                                             .....
                                                    ))
                                                    .Sorters(Html.X().DataSorter().Property("name").Direction(Ext.Net.SortDirection.ASC)
                                                    )                                                    
                                                    .MessageBusListeners(new MessageBusListener()
                                                            {
                                                                Name = "Stations.RegisterMap",
                                                                Fn = "RegisterMap"
                                                            }
                                                    )
                                                    )
                           .ColumnModel(
                                .....
                                Html.X().Column().Text("Station").DataIndex("id").Flex(10).Hideable(false),
                                ......
                             )
                                 .Features(
                                Html.X().GridFilters()
                                    .Local(true)
                                    .Filters(
                                            Html.X().StringFilter().DataIndex("id")
                                    )
                            )
                            .BottomBar(
                                    Html.X().PagingToolbar().HideRefresh(true).Items(
                                                        ....
                                            )
                                    )
                            .SelectionModel(
                                Html.X().RowSelectionModel().Mode(SelectionMode.Multi))
                            .Plugins(
                                Html.X().RowExpander()
                                .SingleExpand(false)
                                .TemplateHtml(...)
    
                            ))
          )
    and i apply my filter in javascript like that:

    var observedStore = Ext.getCmp('ObservedGrid').getStore();
    
        observedStore.filterBy(function (record) {
            return Ext.Array.contains(stationsNameArray, record.get('name'));
        });
    stationsNameArray is an array of names that i want to display throw my gripdPanel.
    i looked to your example and i did't find any difference except the proxy since i'm not using it.
    Last edited by mhd; Jul 31, 2014 at 1:23 PM.
  4. #4
    i looked to your example and i did't find any difference except the proxy since i'm not using it.
    that online example doesn't use any proxy
  5. #5
    any clue how to deal with this problem
  6. #6
    You need to post simple runable sample reproduces the issue
  7. #7
    thanks for your help.
    I just fount the solution: if i remove the GridFilters defined in the Features section i have no more the problem.
    is it a bug or we can't define custom javascript filter beside features gridFilter?
  8. #8
    Sure, it might be a defect. We will investigate if we are ever able to create a sample that reproduces the problem.
    Geoffrey McGill
    Founder
  9. #9
    To reproduce the issue try to use this example https://examples2.ext.net/Examples/G...l_Data_Paging/

    -Add some GridFilters in the Features section of the grid

    -Apply a new filter in the console for example
    App.Store1.filterBy(function(r){return r.data.price > 30;})
    - Try to navigate between grid pages and will get the issue (the second filter will be ignored)
    Last edited by mhd; Jul 31, 2014 at 2:54 PM.

Similar Threads

  1. [CLOSED] GridPanel JavaScript Filter with Paging Problem
    By Django in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 24, 2014, 12:21 PM
  2. Replies: 0
    Last Post: May 31, 2013, 8:06 AM
  3. Gridpanel Paging and Filter Problem.
    By Ganesh3.shirsath in forum 1.x Help
    Replies: 0
    Last Post: Feb 15, 2011, 7:16 AM
  4. Filter vs. GridPanel Paging
    By reiben in forum 1.x Help
    Replies: 3
    Last Post: Dec 09, 2010, 6:07 PM
  5. Replies: 2
    Last Post: Dec 02, 2009, 12:08 PM

Tags for this Thread

Posting Permissions