Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Code Block
languagesql

In this tutorial, we will demonstrate how to sort a datalist by multiple columns. In this sample, we will focus on sorting by three columns: Country, first name, and last name.

Form Design

Image Removed

Datalist Design

Currently, Joget doesn't offer the option to directly sort the datalist by multiple columns natively, however there is a method to do so by using the JDBC Datalist Database Binder.

Image Removed

Image Removed

SQL Select Query

This SQL query will sort the datalist by country, then first name, then last name.

Code Block
titleSQL Query
SELECT c_country
  , c_first_name
  , c_last_name
FROM
  FROM  (
        SELECT c_country
          , c_first_name
          , c_last_name
        FROM
            app_fd_details
        ORDER BY
            c_country asc
          , c_first_name asc
          , c_last_name asc
        LIMIT 18446744073709551615
    )
    alias

Runtime


Download the sample app:

...