[CLOSED] Gridpanel Paging Change Event Issue

  1. #1

    [CLOSED] Gridpanel Paging Change Event Issue

    Hi all, I have a grid panel with a paging plugin, the store for the gridpanel uses a handler to get the data. I have a direct event attached with the paging plugin (ChangeEvent). when the page loads, the event attached to the paging toolbar called twice. here are my questions,

    1.Why this change event fires when the page loads, logically it should only fire when the page changes, for the first page it should not fire
    2. Event if it fires (might be design flaws in ext) why it fires twice.

    Sequence:
    Handlers is called... Change event fires in parallel....
    Handler sends response after that this event fires. It took me hardly 3 hours, I debug all my code and made sure there are nothing related to paging. Kindly give me a solution soon. Kindly remember that I DONT WANT UNNECESSARY POSTBACKS

       
    <ext:Store ID="storeGrid" AutoLoad="true" runat="server" IgnoreExtraFields="true"
                RemoteSort="true" ShowWarningOnFailure="false">
                <Proxy>
                    <ext:HttpProxy Timeout="120000" Url="Handlers/xyz.ashx" Method="GET">
                    </ext:HttpProxy>
                </Proxy>
            </ext:Store>
    
    
      <ext:PagingToolbar ID="PagingToolBar1" runat="server" DisplayInfo="true">
                                        <DirectEvents>
                                            <Change OnEvent="Event1">
                                            </Change>
                                        </DirectEvents>
                                    </ext:PagingToolbar>
  2. #2
    Change event is fired after store's Load event (for example, you can use Load event of store)
    If event is fired twice then it means that store is reloading after initial load
    Please provide test sample demonstrates the issue
  3. #3

    Sample

    you can find the sample in ext.net site itself, just add a paging change event, put the breakpoint in double fire event or use any request analyzer to check this event gets fired twice.. but why.. I dont need this event to be fired at all during initial load, if it is meant for page change , It must only fire during page change not on store load or any other reason... Ext guys please check using some analyzer and give me a solution soon....



    <Change OnEvent="DoubleFireEvent">
    </Change>





    https://examples1.ext.net/#/GridPane...rting/Handler/
  4. #4
    I investigated javascript code of PagingToolbar

    1. First event: toolbar reads store's info and update UI info (current page, total and etc), during UI update event is fired
    2. Store loads data, toolbar updates info and fires event

    It is designed behaviour by ExtJS developers
    I suggest the following code
    <Change OnEvent="PagingChange" Before="var change = (this.getPageData().activePage !== this.lastPage) && Ext.isDefined(this.lastPage); this.lastPage = this.getPageData().activePage; return change;" />
  5. #5
    Thanks for the timely reply.

Similar Threads

  1. [CLOSED] GridPanel: issue with paging when using DirectMethod
    By Leonid_Veriga in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 16, 2012, 10:04 AM
  2. [CLOSED] GridPanel remote paging issue
    By jskibo in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Jan 31, 2011, 8:37 AM
  3. Change Event then Click event : issue
    By jeybonnet in forum 1.x Help
    Replies: 2
    Last Post: May 28, 2010, 1:19 PM
  4. [CLOSED] Gridpanel Paging Button Event
    By speedstepmem2 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 01, 2009, 7:41 AM
  5. [CLOSED] paging toolbar event in GridPanel
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 25, 2009, 7:14 AM

Posting Permissions