4 Replies Latest reply on Jan 26, 2015 5:08 PM by lorenmc RSS
    lorenmc Explorer

    Sort "List" Widget Alphabetically

    Is there a way to have the "List" widget display it's list of items in an alphabetical order based on the "DisplayField" value?

      • Sort "List" Widget Alphabetically
        paic Collaborator

        You will have to pre-sort the information in the service. There is a service available under the infotable functions called Sort.

         

          • Sort "List" Widget Alphabetically
            lorenmc Explorer

            Hi Pai,

             

            I'm not sure exactly how to implement what you are suggesting given my current design.  I'm populating the "List" widget using the "GetImplementingThingsWithData" service. Simliar to how we did in the training class.  How do I pre sort that list?


            Loren



              • Sort "List" Widget Alphabetically
                adam Creator

                Loren,

                 

                The best practice is to wrap the ThingWorx-provided

                Service

                 (e.g.,

                GetImplementingThingsWithData()

                ) in your own

                Service

                . This will allow you to set more granular permissions and in this case, call

                GetImplementingThingsWithData()

                and pass the

                InfoTable

                returned to the

                Sort()

                InfoTableFunction

                all in one

                Service

                .


                – Adam



                  • Sort "List" Widget Alphabetically
                    lorenmc Explorer

                    Hi Adam,

                     

                    I was able to implement your suggestion above for creating a 'sorted' InfoTable by creating my own service.  Thank you. However, when I try and select the property I want in the "DisplayField" of the "List" widget I no longer have access to all the properties like I did when I was using the

                    GetImplementingThingsWithData()

                     service on it's own.  It seems like the only options for the "DisplayField" are now the list of "Generic Properities".  How do I get all the properties to show up?


                    Thanks


                    Loren