# sortingEnable

## Description

Enables the ability to sort a datalist component.

## Input / Parameter

N/A

## Output

N/A

## Callback

N/A

## Video

Coming Soon.

## Example

In this example, we will first create a data list, which can then be made sortable with the `sortingEnable` function.

### Steps

1. First, add a "Enable Sorting" button and a datalsit component to the page.

   ![](/files/BM4OJ8o0Orv6tDYHmKJQ)
2. To load data into the datalist, we will need to create the following event flow.

   ![](/files/6MNbYZM1IiT7Y46g9RDf)

   a. For the `dataFromString` function

   ![](/files/kuUrdqt1uwJk417E3DV5)

   | Field   | Value                            |
   | ------- | -------------------------------- |
   | dataset | l\_user                          |
   | string  | ![](/files/hfb5DpeZmuXkyTctvNTp) |

   b. For the `loadData` function ![](/files/LzN5tC4gEMEqGUtfFFbg)
3. Finally, for our "Enable Sorting" button, we will add the `sortingEnable` function when the button is clicked.

   ![](/files/yj6p44GKumm9IVFr9ayO)

### Result

![](/files/IE25CfNC7ortM5fkKYW7)

## Links


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/app/sortingenable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
