Zum Hauptinhalt gehen

Sorting in a list box

Kommentare

10 Kommentare

  • Nico Burgerhart

    If your listbox directly reads from your mapservice layer, I would  expect the values are sorted alphabetically.

    If the input of your Listbox is a DataItemList from your workflow and if you use FeatureSetToDataItemList to create the DataItemList, there is a Sort property on this activity.

    0
  • Permanently deleted user

    Thanks Nico - The values ALMOST sort alphabetically, any reason why there would be issues with this?  It is reading direct from a mapservice.

     

    https://sgis.wellington.ca/Html5Viewer_2_0/?viewer=businessdirectory

    Click on the Category Search.

    0
  • Nico Burgerhart

    This is the request as sent to the server, the results are unsorted, sorting is (/should be) done in the viewer:

    https://sgis.wellington.ca/Geocortex/Essentials/REST/local-proxy/ED_Business_Directory/2/BusinessDirectory/MapServer/0/query/query?f=json &where=1%3D1&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=Catergories

    If I format the output as HTML (request as below), I see 1000 records are returned. You should increase the MaxRecordCount of your mapservice or choose a different option to populate your combobox. I'm afraid now you are missing values because only the first 1000 records in your data are scanned.

    https://sgis.wellington.ca/Geocortex/Essentials/REST/local-proxy/ED_Business_Directory/2/BusinessDirectory/MapServer/0/query/query?f=html &where=1%3D1&returnGeometry=false&spatialRel=esriSpatialRelIntersects&outFields=Catergories

     

    0
  • Permanently deleted user

    NIco thanks again, sorry if I am a total dingus, but how do you sort "in the viewer"?

    0
  • Nico Burgerhart

    I mean it is done internally in the combobox control (hidden/not configurable)

    0
  • Permanently deleted user

    Nico - sorry, I am completely lost now. Sorting in the viewer is not configurable, but should be sortign my data, and is not. Is there actually nothing I can do to sort the data? I am confused if you are giving me hints on what to do, or if you are just telling me that I can't achieve what I want?

    Paul

    0
  • Nico Burgerhart

    You can get the desired result in the following way:

    - Use a Query Task and set the Out Fields property to your category field and the Return Distinct Values property to True. This will give you a list of unique category values.

    - Use a FeaturesetToDataItemList activity and convert the feature set to a data item list. Set the Sort property on this activity to True. Set the Display and Value property to the name of your category field.

    - Use the data item list as Input Data for your combobox on your Display Form.

    - Now your combobox should show a sorted list of category values.

    0
  • Permanently deleted user

    Amazing - thanks Nico. Very much appreciated.

    0
  • Tyson Schoepflin
    Any tips on interger natural sorting?  FeatureSetToDataItem and SortFeatureSet do not sort integers in a human readable format.
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.