Sorting Data

Rowstack provides built-in sorting capabilities that allow users to quickly organize information. Whether handling thousands of rows or just a few, sorting makes it easier to find specific data points and analyze trends.

#How Sorting Works

Sorting in Rowstack is handled efficiently on the client side. By default, clicking a column header or using the toolbar's sort options will rearrange the data according to the selected field's values.

#Enabling Sorting

Sorting is enabled by default. To explicitly control sorting via the config prop:

const config = {
  sorting: {
    enabled: true
  }
};

<Table data={data} columns={columns} config={config} />

#Interactive Sorting

Users can interact with sorting in several ways:

  1. Toolbar Sort: Click the Sort data button in the toolbar and select the field you want to sort by.

  2. Sort Order: Once a column is selected, users can toggle between Ascending and Descending order.

  3. Visual Feedback: The grid provides clear visual indicators of which column is currently being sorted and in what direction.

#Benefits of Sorting

  • Fast Analysis: Quickly find the highest or lowest values in any given field.
  • Improved Order: Maintain a consistent view of your data, such as alphabetical or chronological order.
  • Enhanced Comparison: Easily compare related records by grouping them together through sorting.