Skip to content
MUI’s hosted AI Assistant backend shuts down at the end of 2026.Switch in two lines →
  • Products
    • AG Grid AI Toolkit Early accessThe model and the server behind the toolkit.
    • MUI X Data Grid StableThe backend for the Premium AI Assistant.
    • TanStack Table Public alphaA plugin that applies each answer to your table.
    • AG Studio Early accessA hosted backend for its assistant, not built yet.
  • How it works
  • Accuracy
  • Pricing
  • Security
  • Docs
    • Quickstart: server route
    • Quickstart: TanStack Table
    • Browser keys
    • Moving from MUI’s hosted service
    • Guide: when MUI’s service retires
Sign inStart a 7-day trial
Menu
  • Products
    • AG Grid AI Toolkit Early access
    • MUI X Data Grid Stable
    • TanStack Table Public alpha
    • AG Studio Early access
  • How it works
  • Accuracy
  • Pricing
  • Security
  • Docs
    • Quickstart: server route
    • Quickstart: TanStack Table
    • Browser keys
    • Moving from MUI’s hosted service
    • Guide: when MUI’s service retires
  • Sign in

Product

  • How it works
  • Accuracy
  • Pricing
  • Data and security

Grids

  • AG Grid AI ToolkitEarly access
  • MUI X Data Grid PremiumStable
  • TanStack TablePublic alpha
  • AG StudioEarly access

Docs

  • Quickstart: server route
  • Browser keys
  • Guide: when MUI’s service retires

Company

  • Contact
  • Terms
  • Privacy

Not affiliated with or endorsed by MUI or AG Grid. MUI and AG Grid are trademarks of their respective owners.

© 2026 Gridsay

Docs pages
Start
  • Documentation
  • How it works
  • Examples
MUI X Data Grid
  • Quickstart: server route
  • From the browser
  • Using the helper
  • Filtering
  • Sorting
  • Grouping
  • Aggregation
  • Pivoting
  • Charts
  • Row selection
  • Follow-up questions
  • Refusals and errors
  • Moving from MUI’s service
  • Reference
TanStack Table
  • Quickstart
  • Describing columns
  • Filtering
  • Sorting
  • Grouping
  • Row selection
  • Server-side data
  • Controlled state
  • Undo and reset
  • Refusals and errors
  • API reference
Keys and sign-in
  • Secret and publishable keys
  • Browser keys
  • JWT and OIDC
  • Session tokens
  • Identity webhook
  • Per-user limits
  • The console
  • Data and privacy
HTTP API
  • HTTP API
  • Authentication
  • Data Grid endpoint
  • Follow-up questions
  • Private mode
Reference
  • Errors
  • Limits
  • Tiers and credits
  • @gridsay/core
On this page

On this page

  1. What it needs
  2. How rows are ordered
  3. The sort a user sets is kept
  4. What it will not do
  5. Next
Skip to the article
Start
  • Documentation
  • How it works
  • Examples
MUI X Data Grid
  • Quickstart: server route
  • From the browser
  • Using the helper
  • Filtering
  • Sorting
  • Grouping
  • Aggregation
  • Pivoting
  • Charts
  • Row selection
  • Follow-up questions
  • Refusals and errors
  • Moving from MUI’s service
  • Reference
TanStack Table
  • Quickstart
  • Describing columns
  • Filtering
  • Sorting
  • Grouping
  • Row selection
  • Server-side data
  • Controlled state
  • Undo and reset
  • Refusals and errors
  • API reference
Keys and sign-in
  • Secret and publishable keys
  • Browser keys
  • JWT and OIDC
  • Session tokens
  • Identity webhook
  • Per-user limits
  • The console
  • Data and privacy
HTTP API
  • HTTP API
  • Authentication
  • Data Grid endpoint
  • Follow-up questions
  • Private mode
Reference
  • Errors
  • Limits
  • Tiers and credits
  • @gridsay/core

Sorting

On this page

  1. What it needs
  2. How rows are ordered
  3. The sort a user sets is kept
  4. What it will not do
  5. Next

Users say which rows come first, and the plugin sets the table's sorting, on one column or several in order.

Ask

newest first

Changes1 change
  1. 1sort Placed, newest first
Ask

Sort the tickets by priority, most urgent first

ChangesNo change
Refused

Tickets can't be sorted by priority in this grid.

Your user reads this sentence. The table stays as it was.

In the second, the priority column keeps the developer's own urgency sortFn, so the assistant is told it cannot sort by it. The sentence is the assistant's own and varies: other recorded answers to the same question were "The Priority column can't be sorted in this grid." and "Sorting by priority is not allowed in this grid."

What it needs#

TypeScript
import { assistantColumn } from '@gridsay/tanstack-table';import {  columnFilteringFeature,  createColumnHelper,  createFilteredRowModel,  createSortedRowModel,  rowSortingFeature,  tableFeatures,} from '@tanstack/react-table'; type Order = { id: string; total: number; status: string; customer: string };export const features = tableFeatures({  columnFilteringFeature,  filteredRowModel: createFilteredRowModel(),  rowSortingFeature,  sortedRowModel: createSortedRowModel(),});const helper = createColumnHelper<typeof features, Order>();export const columns = helper.columns([  helper.accessor('total', {    header: 'Order total',    meta: { assistant: { type: 'number', description: 'Order total in euros, including tax' } },    cell: (info) => `€${info.getValue().toFixed(2)}`,  }),  helper.accessor('status', {    header: 'Status',    meta: {      assistant: {        type: 'singleSelect',        options: [          { value: 'paid', label: 'Paid' },          { value: 'refunded', label: 'Refunded' },        ],      },    },  }),  helper.accessor('customer', {    header: 'Customer',    meta: { assistant: { description: 'Customer display name', examples: ['Example company'] } },  }),]);export const defaultColumn = assistantColumn;
  • rowSortingFeature and sortedRowModel registered in tableFeatures.
  • assistantSort as the column's sortFn with sortUndefined: false, and no invertSorting. assistantColumn sets the first two.
  • Or manualSorting: true, when your server sorts. Then the plugin only sets the sorting state; see Server-side data.

How rows are ordered#

assistantSort orders cells by the column's type:

TypeOrder
number, booleanOrderBy value.
date, dateTimeOrderBy time.
Text and the restOrderAlphabetically, in the browser's locale.

Empty cells come first in ascending order and last in descending order. Rows that tie keep the order of your data. Group rows keep their order; the rows inside them are sorted.

The sort a user sets is kept#

An answer replaces the table's sorting. Every question also sends the current sorting, so a sort the user set by clicking a header goes with the next question, and a follow-up keeps it unless the user asks for another order.

What it will not do#

  • Sort by a column that cannot be sorted: one with enableSorting: false, or its own sortFn on a table that sorts in the browser.
  • Sort by a value the table does not have, such as a total per group.

Each is declined: ask resolves false, the table stays as it was, and error.message is the assistant's sentence. A declined question is charged. See Refusals and errors.

Next#

  • Grouping
  • Row selection
  • Server-side data