@cmds/sort-settings
v1.0.0
Published
Used for configuring sorters in a view.
Downloads
2
Readme
SortSettings
Used for configuring sorters in a view.
Example
<SortSettings
fields={[{
id: 'fld1',
name: 'Field 1'
}, {
id: 'fld2',
name: 'Field 2'
}, {
id: 'fld3',
name: 'Field 3'
}]}
sorters={[{
id: 'srt1',
fieldId: 'fld1',
ascending: true
}, {
id: 'srt2',
fieldId: 'fld2',
ascending: true
}, {
id: 'srt3',
fieldId: 'fld3',
ascending: false
}]}
onCreate={() => {
// do something
}}
onRemove={({id}) => {
// do something
}}
onSort={({oldIndex, newIndex}) => {
// do something
}}
onFieldIdChange={({id, fieldId}) => {
// do something
}}
onAscendingChange={({id, ascending}) => {
// do something
}}
/>