LearnNewsExamplesServices
Frontmatter
id9306
titleImplement two-state (ASC/DESC) sorting for Grid headers
stateClosed
labels
enhancementai
assigneestobiu
createdAtFeb 26, 2026, 2:12 PM
updatedAtFeb 26, 2026, 2:16 PM
githubUrlhttps://github.com/neomjs/neo/issues/9306
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtFeb 26, 2026, 2:16 PM

Implement two-state (ASC/DESC) sorting for Grid headers

Closed v12.0.0 enhancementai
tobiu
tobiu commented on Feb 26, 2026, 2:12 PM

Problem: Currently, Neo.mjs grid header buttons use tri-state sorting (ASC, DESC, null). This was originally designed to allow reverting to an unsorted state and testing collection.allItems. However, for most real-world use cases (like the DevIndex grid), a two-state sorting mechanism (ASC, DESC) is more intuitive and expected by users.

Proposed Solution: Introduce a new reactive configuration, useTriStateSorting_, on grid components. This config should default to false (enabling two-state sorting by default) and propagate from the GridContainer down to the HeaderToolbar and finally to the individual HeaderButtons.

  • src/grid/header/Button.mjs: Add useTriStateSorting_: false and update onClick to bypass the null state based on this config.
  • src/grid/header/Toolbar.mjs: Add useTriStateSorting_: false to propagate the setting to its child buttons and respond to dynamic changes.
  • src/grid/Container.mjs: Expose useTriStateSorting_: false to provide a top-level developer API to configure sorting behavior for the entire grid.
tobiu added the enhancement label on Feb 26, 2026, 2:12 PM
tobiu added the ai label on Feb 26, 2026, 2:12 PM
tobiu referenced in commit 915a2c9 - "feat(grid): Implement two-state (ASC/DESC) sorting for Grid headers (#9306)" on Feb 26, 2026, 2:15 PM
tobiu
tobiu Feb 26, 2026, 2:15 PM

Input from Gemini 3.1 Pro:

✦ I have implemented the useTriStateSorting_: false configuration across the GridContainer, HeaderToolbar, and HeaderButton components to enable two-state sorting (ASC/DESC) by default. The changes have been pushed to the dev branch.

tobiu assigned to @tobiu on Feb 26, 2026, 2:16 PM
tobiu closed this issue on Feb 26, 2026, 2:16 PM