@gridstorm/plugin-sorting
v0.1.2
Published
GridStorm sorting plugin — single and multi-column sorting
Downloads
146
Maintainers
Readme
@gridstorm/plugin-sorting
Single and multi-column sorting for GridStorm.
Install
npm install @gridstorm/plugin-sorting @gridstorm/coreUsage
import { createGridEngine } from '@gridstorm/core';
import { SortingPlugin } from '@gridstorm/plugin-sorting';
const engine = createGridEngine({
columnDefs: [
{ field: 'name', sortable: true },
{ field: 'age', sortable: true, type: 'number' },
],
rowData: myData,
plugins: [SortingPlugin()],
});
// Sort programmatically
engine.dispatchCommand('sort:set', { field: 'name', direction: 'asc' });Features
- Click column headers to cycle through asc/desc/none
- Multi-column sort with Shift+click
- Custom comparator functions
- Programmatic sort API via commands
Documentation
License
MIT
