<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cancelling an already running query in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758246#M70141</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've tried setting up and use cancel method for a queryTask. Every time I cancel a query operation, though, I get an dojo.io.script error.&lt;BR /&gt;&lt;BR /&gt;I think the query is genuinely terminated, I'm just worried about that error callback I'm getting.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I dont think the querytask has a cancel method, at least not according to the API documentation.&amp;nbsp; Once the query is submitted to the server I don't think there is much you can do to stop it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Feb 2012 17:01:57 GMT</pubDate>
    <dc:creator>JeffPace</dc:creator>
    <dc:date>2012-02-22T17:01:57Z</dc:date>
    <item>
      <title>Cancelling an already running query</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758244#M70139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have an application that queries the mapserver as you type in a text box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there a way to cancel a query? The situation is that a user might type in the text box; the first letter sends a query for that one letter, but then the user types a second letter, such that there are 2 queries running simultaneously, and the 2nd query comes back before the 1st query. E.g. a user types "r", which takes a while for the server to return the results for, but before that happens the user has subsequently typed "re", a shorter query which comes back before the first one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to cancel any running query as soon as a letter is typed, maybe have an IF condition for checking if a query is already running, or some other similar solution.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 08:47:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758244#M70139</guid>
      <dc:creator>Salomon_VágadalJoensen</dc:creator>
      <dc:date>2012-02-22T08:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling an already running query</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758245#M70140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've tried setting up and use cancel method for a queryTask. Every time I cancel a query operation, though, I get an dojo.io.script error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the query is genuinely terminated, I'm just worried about that error callback I'm getting.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 10:06:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758245#M70140</guid>
      <dc:creator>Salomon_VágadalJoensen</dc:creator>
      <dc:date>2012-02-22T10:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling an already running query</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758246#M70141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've tried setting up and use cancel method for a queryTask. Every time I cancel a query operation, though, I get an dojo.io.script error.&lt;BR /&gt;&lt;BR /&gt;I think the query is genuinely terminated, I'm just worried about that error callback I'm getting.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I dont think the querytask has a cancel method, at least not according to the API documentation.&amp;nbsp; Once the query is submitted to the server I don't think there is much you can do to stop it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 17:01:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758246#M70141</guid>
      <dc:creator>JeffPace</dc:creator>
      <dc:date>2012-02-22T17:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling an already running query</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758247#M70142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I got the inspiration for query cancellation from here, the 2nd last post code snippet:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/36248-Is-it-possible-to-destroy-a-QueryTask-while-it-s-executing"&gt;http://forums.arcgis.com/threads/36248-Is-it-possible-to-destroy-a-QueryTask-while-it-s-executing&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: Also, I've looked at dojo deferred list, if that can be used, but am unsure on how to.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Feb 2012 17:40:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758247#M70142</guid>
      <dc:creator>Salomon_VágadalJoensen</dc:creator>
      <dc:date>2012-02-22T17:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Cancelling an already running query</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758248#M70143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;We had a similar thing while searching against a database used for an interactive quick search much like google. The solution was to set up a timer to wait for a number of seconds before auto running the query. If the user typed another letter before the timeout value then the timer would reset and start again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Something like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;check for keyup event inside text entry box first.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;STRONG&gt;dojo.connect(this.qSearch, "onkeyup", this, dojo.hitch(this, "_checkInput"));&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;this.qSearch &lt;/SPAN&gt;&lt;SPAN&gt; is a ref to the Dom node of the input box.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The timer function runs before doing the query in the _filterText function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _checkInput: function () {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clearTimeout(this.timer);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.timer = setTimeout(dojo.hitch(this, "_filterText"), 2000);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;BR /&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this hitches to the function you want to run once the timeout reaches 2 seconds. If a key is pressed before the 2 seconds has expired the timer begins again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Mar 2012 09:36:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cancelling-an-already-running-query/m-p/758248#M70143</guid>
      <dc:creator>markburrell</dc:creator>
      <dc:date>2012-03-30T09:36:34Z</dc:date>
    </item>
  </channel>
</rss>

