Paging toolbar refresh after filter

  1. #1

    Paging toolbar refresh after filter

    I have a store & grid filer that has the following set

    
                                            <Store>
                                                <ext:Store runat="server" id="_Directory" RemotePaging="false" OnRefreshData="Directory_Refresh" AutoLoad="True">
                                                    
                                                    <Reader>                                                             
                                                        <ext:JsonReader IDProperty="login">
                                                            <Fields>
                                                                <ext:RecordField Name="login" Type="String" />
                                                            </Fields>
                                                        </ext:JsonReader>                                                     
                                                    </Reader> 
                                                    <Proxy>
                                                        <ext:PageProxy></ext:PageProxy>
                                                    </Proxy>
                                                    <BaseParams>
                                                        <ext:Parameter Name="start" Value="0" Mode="Raw" />
                                                        <ext:Parameter Name="limit" Value="25" Mode="Raw" />
                                                    </BaseParams>                                                                                                 
                                                </ext:Store> 
                                            
                                            </Store>
    
                                               <ext:GridFilters runat="server" ID="GridFilters1" Local="True">
                                                    <Filters>
                                                        <ext:StringFilter DataIndex="fullname" />
                                                        <ext:StringFilter DataIndex="jobtitle" />
                                                    </Filters>
                                                </ext:GridFilters>
    I have had to use the page proxy otherwise the load mask does not show.

    So how would I refresh the paging toolbar in this scenario, because as soon as a filter is applied the paging toolbar is not updated.
    If you use the paging toolbar (e.g page forward) once the filter is applied then no problem as it updates.

    You can see a similar problem here http://examples1.ext.net/#/GridPanel...Filters_Local/
    Goto page 2 then click Find 3m Co, once the filter is applied the paging toolbar is incorrect.

    Is there an event fire's after the filter is applied so I can manually update the paging toolbar?

    Thanks,
    Dan
  2. #2

    Found it

    Manually refreshing the toolbar does the trick but for some reason I have to do it twice.

    
                                                <FilterUpdate OnEvent="GridPanel_Filter">                                              
                                                </FilterUpdate>
    
        protected void GridPanel_Filter(object sender, DirectEventArgs e)
        {
    
            // Reset pager
            this.PagingToolBar1.SetPageIndex(0);
            this.PagingToolBar1.SetPageIndex(0);
    
        }
  3. #3

    Mmmm

    Using the SetPageIndex is actually a dreadful solution to getting the pager to update and it re-renders the grid.
    Further complications come if you have external filters as this event can fire multiple times.

    So back to square 1 really of trying to find a solution for refreshing the pager after a filter has been applied.
  4. #4

    Filter

    Hi
    If I have this:

      <Filters>
          <ext:StringFilter DataIndex="ID" />
          <ext:NumericFilter DataIndex="NAME" />
      </Filters>
      <DirectEvents>
          <FilterUpdate OnEvent="FilterDate">
          </FilterUpdate>
      </DirectEvents>
    Why event FilterDate is not fired?
    With other words: I need this: when user enter something in the filter filed, it should run some event.
    How to do that?
    Thanks
  5. #5
    Hi

    Everything looks ok to me in terms of the HTML, have you set up the event with the correct signature in the code behind file.
    You can find the signature from earlier in my post and also the examples explorer.

    Dan

    Quote Originally Posted by UserClarion View Post
    Hi
    If I have this:

      <Filters>
          <ext:StringFilter DataIndex="ID" />
          <ext:NumericFilter DataIndex="NAME" />
      </Filters>
      <DirectEvents>
          <FilterUpdate OnEvent="FilterDate">
          </FilterUpdate>
      </DirectEvents>
    Why event FilterDate is not fired?
    With other words: I need this: when user enter something in the filter filed, it should run some event.
    How to do that?
    Thanks
  6. #6
    Hi
    this is event code:
        protected void FilterDate(object sender, DirectEventArgs e)
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title = "ALert",
                    Message = "Some alert text",
                    Width = 300,
                });
            }
    That event is fired when I call them from under some Button click, but it will not fire when user enter some value into Filer fields.
    Thanks.
    Last edited by geoffrey.mcgill; Apr 26, 2016 at 1:02 AM.
  7. #7
    Have a look through the grid properties and see if there are any properties controlling key events as it sounds like that type of problem.

Similar Threads

  1. [CLOSED] [1.0.0] Hide Refresh Button on Paging Toolbar
    By cobiscorp in forum 1.x Legacy Premium Help
    Replies: 8
    Last Post: Jan 23, 2014, 11:01 AM
  2. [CLOSED] Refresh Event in Paging Toolbar
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Aug 06, 2011, 2:46 PM
  3. Paging Toolbar (hide refresh button)
    By marcmvc in forum 1.x Help
    Replies: 1
    Last Post: Apr 16, 2010, 7:01 PM
  4. Replies: 1
    Last Post: Aug 24, 2009, 1:37 PM
  5. [CLOSED] Paging Toolbar without refresh button?
    By Sharon in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 20, 2009, 10:11 AM

Posting Permissions