<?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: FindTask Custom Widget: Search Results Not Displaying in Table Grid  in Web AppBuilder Custom Widgets Questions</title>
    <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/findtask-custom-widget-search-results-not/m-p/792256#M4273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There where a couple of issues with your code, but since you where using DataGrid instead of the newer dGrid I changed a lot of your code. Attached is a new version of your widget using dGrid and the selection extension for dgrid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Jan 2020 16:52:25 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2020-01-23T16:52:25Z</dc:date>
    <item>
      <title>FindTask Custom Widget: Search Results Not Displaying in Table Grid</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/findtask-custom-widget-search-results-not/m-p/792255#M4272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #333f50;"&gt;I am trying to build a custom widget for Web App Builder that has the same functionality as the FindTask class in the Java Script API.&amp;nbsp; Thus far, my code searches for an attribute value in a rest service (i.e. owner name of a parcel) and returns the search results in the Dev Tool’s Console window, NOT in a table grid that I am striving for. &amp;nbsp;I am a Java Script novice and would appreciate any guidance or suggestions as to what my code is lacking to output the search results into a table grid.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333f50;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333f50;"&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #333f50; "&gt;Here is the Widget.js code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;define([&lt;BR /&gt; // Specify required modules&lt;BR /&gt; "dojo/_base/declare",&lt;BR /&gt; "jimu/BaseWidget",&lt;BR /&gt; "esri/tasks/FindTask",&lt;BR /&gt; "esri/tasks/FindParameters",&lt;BR /&gt; "esri/symbols/SimpleFillSymbol",&lt;BR /&gt; "dojox/grid/DataGrid",&lt;BR /&gt; "dojo/_base/array",&lt;BR /&gt; "esri/symbols/SimpleLineSymbol",&lt;BR /&gt; "esri/graphic",&lt;BR /&gt; "dojo/data/ItemFileReadStore",&lt;BR /&gt; "dojo/_base/Color"&lt;BR /&gt;],&lt;BR /&gt; function (&lt;BR /&gt; declare,&lt;BR /&gt; BaseWidget,&lt;BR /&gt; FindTask,&lt;BR /&gt; FindParameters,&lt;BR /&gt; SimpleFillSymbol,&lt;BR /&gt; DataGrid,&lt;BR /&gt; arrayUtils,&lt;BR /&gt; SimpleLineSymbol,&lt;BR /&gt; Graphic,&lt;BR /&gt; ItemFileReadStore,&lt;BR /&gt; Color&lt;BR /&gt; ) {&lt;BR /&gt; var clazz = declare([BaseWidget], {&lt;BR /&gt; baseClass: 'jimu-widget-demo',&lt;BR /&gt; _getMapId: function () {&lt;BR /&gt; alert(this.map.id);&lt;BR /&gt; },&lt;BR /&gt; postCreate: function () {&lt;BR /&gt; this.grid = new DataGrid({&lt;BR /&gt; rowsPerPage: '5', rowSelector: '20px'&lt;BR /&gt; }, this.searchResultsTable);&lt;BR /&gt; },&lt;/P&gt;&lt;P&gt;buttonClickHandler: function () {&lt;BR /&gt; console.log('clicked!', this.searchBox.value);&lt;/P&gt;&lt;P&gt;var find = new FindTask("https://maps.co.blaine.id.us/server/rest/services/ParcelInfo/MapServer");&lt;BR /&gt; var params = new FindParameters();&lt;BR /&gt; //params.returnGeometry = true; &lt;BR /&gt; params.layerIds = [5];&lt;BR /&gt; params.searchFields = ["parcel_num", "owner1"];&lt;BR /&gt; //params.outSpatialReference = map.spatialReference; &lt;BR /&gt; params.searchText = this.searchBox.value;&lt;BR /&gt; find.execute(params, (results) =&amp;gt; {&lt;BR /&gt; console.log('results', results[0]);&lt;BR /&gt; // this.resultsArea.innerHTML = JSON.stringify(results); //returns results in widget window&lt;BR /&gt; this.showResults(results);&lt;BR /&gt; });&lt;BR /&gt; },&lt;BR /&gt; &lt;BR /&gt; showResults: function (results) {&lt;BR /&gt; this.map.graphics.clear();&lt;BR /&gt; var symbol = new SimpleFillSymbol(&lt;BR /&gt; SimpleFillSymbol.STYLE_SOLID,&lt;BR /&gt; new SimpleLineSymbol(SimpleLineSymbol.STYLE_SOLID, new Color([98, 194, 204]), 3),&lt;BR /&gt; new Color([255, 255, 255, 0])&lt;BR /&gt; );&lt;/P&gt;&lt;P&gt;//create array of attributes&lt;BR /&gt; var items = arrayUtils.map(results, (result) =&amp;gt; {&lt;BR /&gt; var graphic = new Graphic(result.feature.toJson());&lt;BR /&gt; graphic.setSymbol(symbol);&lt;BR /&gt; this.map.graphics.add(graphic);&lt;BR /&gt; return result.feature.attributes;&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;var data = {&lt;BR /&gt; identifier: "FID", //This field needs to have unique values&lt;BR /&gt; label: "RecordNo", //Name field for display. Not pertinent to a grid but may be used elsewhere.&lt;BR /&gt; items: items&lt;BR /&gt; };&lt;BR /&gt; console.log('items', items);&lt;/P&gt;&lt;P&gt;//Create data store and bind to grid.&lt;BR /&gt; store = new ItemFileReadStore({&lt;BR /&gt; data: data&lt;BR /&gt; });&lt;BR /&gt; this.grid.setStore(store);&lt;BR /&gt; //this.grid.on("rowclick", onRowClickHandler);&lt;/P&gt;&lt;P&gt;//Zoom back to the initial map extent&lt;BR /&gt; //map.centerAndZoom(center, zoom);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;});&lt;BR /&gt; return clazz;&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is the Widget.html code:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div&amp;gt;&lt;BR /&gt; Parcel Number/Owner Name/Address/Legal Description:&lt;BR /&gt; &amp;lt;input type="text" data-dojo-attach-point="searchBox" size="35" /&amp;gt;&lt;BR /&gt; &amp;lt;button class="favorite styled" type="button" data-dojo-attach-event="click:buttonClickHandler"&amp;gt;&lt;BR /&gt; Search&lt;BR /&gt; &amp;lt;/button&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-attach-point="resultsArea"&amp;gt;&amp;lt;/div&amp;gt;&lt;BR /&gt; &amp;lt;div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom', splitter:'true'"&lt;BR /&gt; style="height:150px;font-size:10pt;"&amp;gt;&lt;BR /&gt; &amp;lt;table data-dojo-attach-point="searchResultsTable"&amp;gt;&lt;BR /&gt; &amp;lt;thead&amp;gt;&lt;BR /&gt; &amp;lt;tr&amp;gt;&lt;BR /&gt; &amp;lt;th field="Parcel_Num" width="10%"&amp;gt;Parcel ID&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Owner1" width="11%"&amp;gt;Owner 1&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Owner2" width="11%"&amp;gt;Owner 2&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Prop_Adrs1" width="11%"&amp;gt;Property Address&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Prop_Adrs2" width="8%"&amp;gt;City&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Lgl_Desc1" width="8%"&amp;gt;Legal 1&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Lgl_Desc2" width="8%"&amp;gt;Legal 2&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Lgl_Desc3" width="8%"&amp;gt;Legal 3&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Lgl_Desc4" width="8%"&amp;gt;Legal 4&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;th field="Lgl_Desc5" width="8%"&amp;gt;Legal 5&amp;lt;/th&amp;gt;&lt;BR /&gt; &amp;lt;/tr&amp;gt;&lt;BR /&gt; &amp;lt;/thead&amp;gt;&lt;BR /&gt; &amp;lt;/table&amp;gt;&lt;BR /&gt; &amp;lt;/div&amp;gt;&lt;BR /&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jan 2020 18:38:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/findtask-custom-widget-search-results-not/m-p/792255#M4272</guid>
      <dc:creator>KellyGreen</dc:creator>
      <dc:date>2020-01-22T18:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: FindTask Custom Widget: Search Results Not Displaying in Table Grid</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/findtask-custom-widget-search-results-not/m-p/792256#M4273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kelly,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There where a couple of issues with your code, but since you where using DataGrid instead of the newer dGrid I changed a lot of your code. Attached is a new version of your widget using dGrid and the selection extension for dgrid.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 16:52:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/findtask-custom-widget-search-results-not/m-p/792256#M4273</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2020-01-23T16:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: FindTask Custom Widget: Search Results Not Displaying in Table Grid</title>
      <link>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/findtask-custom-widget-search-results-not/m-p/792257#M4274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: #323e4f;"&gt;Hi Robert,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: #323e4f;"&gt;Thank you for the suggestion on using dGrid instead of DataGrid.&amp;nbsp; I tested your code in my wab app and it works like a charm!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.0pt; color: #323e4f;"&gt;Thanks,&lt;BR /&gt; Kelly&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jan 2020 17:52:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/web-appbuilder-custom-widgets-questions/findtask-custom-widget-search-results-not/m-p/792257#M4274</guid>
      <dc:creator>KellyGreen</dc:creator>
      <dc:date>2020-01-23T17:52:48Z</dc:date>
    </item>
  </channel>
</rss>

