-
-
Notifications
You must be signed in to change notification settings - Fork 202
Implement two-state (ASC/DESC) sorting for Grid headers #9306
Copy link
Copy link
Closed
Labels
Description
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: 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.
Reactions are currently unavailable