[CLOSED] Delay firing of Direct Method ...

  1. #1

    [CLOSED] Delay firing of Direct Method ...

    I have a gridpanel with a checkbox column.
    When the checkbox is checked/unchecked, it fires an ajax call to update data using a handler...
    The problem is that if a user runs down the list really quick, it fires a bunch of times...

    The return of the direct method causes the entire grid to refresh...

    Any good ideas? Any simple way?

    I just want to be able to cancel a call, or not reload the grid if there is a pending call...

    Does the "Delay" effectively cancel any previous calls? Or do they Q up and after a 5 second delay are you left with 10 calls that are going to fire?


    This fires after each "check"
    $.ajax({
                    type: "POST",
                    url: "/Handler/BalanceSheetGridUpdateHandler.ashx",
                    data: JSON.stringify(arrChanges),
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    error: function (msg) {
                         
                        scripts.messageTop('Error', msg.responseText, 'danger');
                    },
                    success: function (response) {
                         
                        App.ContentPlaceHolder1_store.load();  <--this then reloads the entire grid...
                         
                    }
                });
    The store is configured as such:

                    <Store>
                        <ext:Store ID="store" runat="server" GroupField="GroupTitle">
                            <Proxy>
                                <ext:AjaxProxy Json="true" Url="/Handler/PerformanceMetricsGridHandler.ashx">
                                    <ActionMethods Read="POST" />
                                    <Reader>
                                        <ext:JsonReader Root="records" />
                                    </Reader> 
                                </ext:AjaxProxy>
                            </Proxy>
                            <Parameters>
                                <ext:StoreParameter Name="metricType" Value="#{hidMetricType}.getValue()" Mode="Raw" />
                                <ext:StoreParameter Name="docId" Value="#{hidDocumentId}.getValue()" Mode="Raw" />
                            </Parameters>
                            <Sorters>
                            </Sorters>
                             <Listeners> 
                                 <Refresh Handler="footnoteCount=0;#{storeFootnotes}.load(); " />
                                     <Load Handler="footnoteCount=0;#{storeFootnotes}.load();" />
                             </Listeners>
                        </ext:Store>
                    </Store>
    Last edited by Daniil; Apr 15, 2014 at 11:19 PM. Reason: [CLOSED]
  2. #2
    Hi @rthiney,

    It might be enough to use the Buffer setting for a listener which you use listen to check/uncheck events.

Similar Threads

  1. Replies: 2
    Last Post: May 13, 2014, 8:52 AM
  2. Direct Method is not firing
    By amida in forum 2.x Help
    Replies: 1
    Last Post: Mar 25, 2013, 7:24 AM
  3. [CLOSED] Output Cache issue with Direct Method / Direct Event
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 01, 2013, 5:03 AM
  4. UserControl Direct Method is not Firing...
    By nagesh in forum 2.x Help
    Replies: 3
    Last Post: Nov 29, 2012, 1:06 PM

Posting Permissions