<?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 QueryTask On Style event listener in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540817#M50350</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to update the following code to On Style event listener:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; dojo.connect(queryTask, "onComplete", function (fset) {&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From what I've read it might be something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;queryTask.on("complete", function (fset) {
or
queryTask.on("execute-complete", function (fset) {&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;They don't work. I was able to get the buffer complete working:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;gsvc.on("buffer-complete", function (result) {&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Oct 2013 17:16:53 GMT</pubDate>
    <dc:creator>GordonBooth</dc:creator>
    <dc:date>2013-10-01T17:16:53Z</dc:date>
    <item>
      <title>QueryTask On Style event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540817#M50350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to update the following code to On Style event listener:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt; dojo.connect(queryTask, "onComplete", function (fset) {&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From what I've read it might be something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;queryTask.on("complete", function (fset) {
or
queryTask.on("execute-complete", function (fset) {&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;They don't work. I was able to get the buffer complete working:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;gsvc.on("buffer-complete", function (result) {&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 17:16:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540817#M50350</guid>
      <dc:creator>GordonBooth</dc:creator>
      <dc:date>2013-10-01T17:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask On Style event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540818#M50351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've seen people use the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var qt = new QueryTask(url);
var query = new Query();
query.where = "1=1";
query.returnGeometry = false;
query.outFields = outFieldsArr;
qt.execute(query, function (results) {
 console.log("results:", results);
 //do something else
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Although this isn't using the on event specifically, it may help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:27:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540818#M50351</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2021-12-11T23:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask On Style event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540819#M50352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply however, I would like to update the existing code to On Style event listener. Anybody?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 17:48:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540819#M50352</guid>
      <dc:creator>GordonBooth</dc:creator>
      <dc:date>2013-10-01T17:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: QueryTask On Style event listener</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540820#M50353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var qt = new QueryTask(url);
var query = new Query();
query.where = "1=1";
query.returnGeometry = false;
query.outFields = outFieldsArr;
qt.execute(query, function (results) {
 console.log("results:", results);
 //do something else
});

on(qt, "complete", function(results){
 console.log('test');
}); 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above worked for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your app is failing silently and events aren't being triggered, use a try/catch block to identify at what point your code fails.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:27:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/querytask-on-style-event-listener/m-p/540820#M50353</guid>
      <dc:creator>JonathanUihlein</dc:creator>
      <dc:date>2021-12-11T23:27:51Z</dc:date>
    </item>
  </channel>
</rss>

