Frontmatter
| id | 9306 |
| title | Implement two-state (ASC/DESC) sorting for Grid headers |
| state | Closed |
| labels | enhancementai |
| assignees | tobiu |
| createdAt | Feb 26, 2026, 2:12 PM |
| updatedAt | Feb 26, 2026, 2:16 PM |
| githubUrl | https://github.com/neomjs/neo/issues/9306 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Feb 26, 2026, 2:16 PM |
Implement two-state (ASC/DESC) sorting for Grid headers

tobiu
Feb 26, 2026, 2:15 PM
Input from Gemini 3.1 Pro:
✦ I have implemented the
useTriStateSorting_: falseconfiguration across theGridContainer,HeaderToolbar, andHeaderButtoncomponents to enable two-state sorting (ASC/DESC) by default. The changes have been pushed to thedevbranch.
tobiu assigned to @tobiu on Feb 26, 2026, 2:16 PM
tobiu closed this issue on Feb 26, 2026, 2:16 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 tofalse(enabling two-state sorting by default) and propagate from theGridContainerdown to theHeaderToolbarand finally to the individualHeaderButtons.src/grid/header/Button.mjs: AdduseTriStateSorting_: falseand updateonClickto bypass thenullstate based on this config.src/grid/header/Toolbar.mjs: AdduseTriStateSorting_: falseto propagate the setting to its child buttons and respond to dynamic changes.src/grid/Container.mjs: ExposeuseTriStateSorting_: falseto provide a top-level developer API to configure sorting behavior for the entire grid.