<?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 Sample Flex Viewer - Sort on the Search widget to return records alphabetically in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/sample-flex-viewer-sort-on-the-search-widget-to/m-p/463736#M10677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This seems like a rather easy question, but does anyone know how to return a search alphabetically by a field name?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the following fields returned in a search:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PTA_NUMBER,PARKNAME,LOCATION,FIREENTRY,WORKPLAN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but I would like the records to be sorted alphabetically by the ParkName.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found this post for LiveLayers, but am a little confused how to implement it for the Search Widget (assuming it�??s supposed to go within the function createRecordData?).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/thread.asp?c=158&amp;amp;f=2421&amp;amp;t=285419"&gt;http://forums.esri.com/thread.asp?c=158&amp;amp;f=2421&amp;amp;t=285419&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var recAC:ArrayCollection = createRecordData(featureSet);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//BJ: sort out the data, 7/2/2009&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var dataSortField:SortField = new SortField();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dataSortField.name="title";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var alphabetDataSort:Sort = new Sort();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alphabetDataSort.fields=[dataSortField];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;recAC.sort=alphabetDataSort;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;recAC.refresh();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//BJ: End&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this post as well:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/"&gt;http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but I�??m just not sure how to implement....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 May 2010 16:17:02 GMT</pubDate>
    <dc:creator>MegPeterson</dc:creator>
    <dc:date>2010-05-19T16:17:02Z</dc:date>
    <item>
      <title>Sample Flex Viewer - Sort on the Search widget to return records alphabetically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/sample-flex-viewer-sort-on-the-search-widget-to/m-p/463736#M10677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This seems like a rather easy question, but does anyone know how to return a search alphabetically by a field name?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the following fields returned in a search:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PTA_NUMBER,PARKNAME,LOCATION,FIREENTRY,WORKPLAN&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;but I would like the records to be sorted alphabetically by the ParkName.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I found this post for LiveLayers, but am a little confused how to implement it for the Search Widget (assuming it�??s supposed to go within the function createRecordData?).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.esri.com/thread.asp?c=158&amp;amp;f=2421&amp;amp;t=285419"&gt;http://forums.esri.com/thread.asp?c=158&amp;amp;f=2421&amp;amp;t=285419&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;var recAC:ArrayCollection = createRecordData(featureSet);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//BJ: sort out the data, 7/2/2009&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var dataSortField:SortField = new SortField();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dataSortField.name="title";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var alphabetDataSort:Sort = new Sort();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;alphabetDataSort.fields=[dataSortField];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;recAC.sort=alphabetDataSort;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;recAC.refresh();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;//BJ: End&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this post as well:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/"&gt;http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and-sort-classes/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but I�??m just not sure how to implement....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help would be appreciated. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 16:17:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/sample-flex-viewer-sort-on-the-search-widget-to/m-p/463736#M10677</guid>
      <dc:creator>MegPeterson</dc:creator>
      <dc:date>2010-05-19T16:17:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sample Flex Viewer - Sort on the Search widget to return records alphabetically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/sample-flex-viewer-sort-on-the-search-widget-to/m-p/463737#M10678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you can't use the example from de LiveLayers because you have the field PARKNAME inside a string (&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;recAC[0].content), which you won't be able to separate and sort by that... I tried to sort it before that but the same problem happened, when you recive the query you get a featureset.features wich is an array but can use Array.sort() cause the field are in a second array called attributes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I gues the other two options are, 1 try to make a more complex Array.sort(complexNewFunction) so it can look inside the attributes array and compare.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Or try to sort the query before you even send it, i mean on the SerachWidget.xml configuration file, maybe you can specify a SORT BY an the end of the query (dont know much on the gis side).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this help at least on trying a different approach&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 May 2010 18:33:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/sample-flex-viewer-sort-on-the-search-widget-to/m-p/463737#M10678</guid>
      <dc:creator>DanielAlvarez</dc:creator>
      <dc:date>2010-05-19T18:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Sample Flex Viewer - Sort on the Search widget to return records alphabetically</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/sample-flex-viewer-sort-on-the-search-widget-to/m-p/463738#M10679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Works Great!&amp;nbsp; Thanks Guys:cool:&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 15:48:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/sample-flex-viewer-sort-on-the-search-widget-to/m-p/463738#M10679</guid>
      <dc:creator>DaveKirkley</dc:creator>
      <dc:date>2011-04-19T15:48:40Z</dc:date>
    </item>
  </channel>
</rss>

