Apr 09, 2014, 10:09 PM
[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"
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]