Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    TileGrid sortByProperty() not sorting...

    Hi there,

    I am trying to use the TileGrid.sortByProperty() method to display the tiles in a given order based on a field from the DataSource. However it is not doing anything... Attached is a test case where the tiles appear in the same order as are provided by the data source.

    SmartClient Version: v12.1p_2020-06-19/LGPL Development Only (built 2020-06-19)
    Attached Files

    #2
    Try setSort(). sortByProperty is for after draw(). We'll clarify in the docs.

    Comment


      #3
      I may be missing something but there is no setSort() method for TileGrid...

      Comment


        #4
        Isomorphic It's not in the SmartGWT docs, only SmartClient. SmartGWT's DataBoundComponent does not have it.

        Best regards
        Blama

        Comment


          #5
          Isomorphic Any update on this? Is there any possibility to control the order of the tiles in a TileGrid?

          Comment


            #6
            We plan to extend the DataBoundComponent API to provide the same setsort() method you find on ListGrid.

            Until that time, you can sort a TileGrid by installing a data arrived handler that calls sortByProperty() after data is present. The reason it fails in your test code is because it's applying a one-time sort to the current data of the TileGrid, which at the time of your call is an empty array (rather than a ResultSet, which is returned from the fetch).

            Comment


              #7
              The data arrived handler workaround does the job. Thank you!

              Comment

              Working...
              X