Set "headerSortTristate" On Higher Level(s)
See original GitHub issueCurrent Behavior | per column basis If I’d like to have tristate sorting I have to set it on a per column basis, which feels cumbersome if I want to have it on all columns.
new require('tabulator-tables')('selector', {
data: { k1: 'v1', k2: 'v2' },
columns: [
{
title: 'K1',
field: 'k1',
headerSortTristate: true // enable tristate sorting per column
},
{
title: 'K2',
field: 'k2',
headerSortTristate: true // enable tristate sorting per column again & again
},
]
});
Desired Behavior | per table & column basis Set tristate sorting as a default value for all columns in advance plus having the ability to overwrite the default settings on per column basis.
new require('tabulator-tables')('selector', {
headerSortTristate: true, // enable tristate sorting for all columns in advance
data: { k1: 'v1', k2: 'v2' },
columns: [
{
title: 'K1',
field: 'k1',
headerSortTristate: false // overwrite tristate sorting per column (optional)
},
{
title: 'K2',
field: 'k2'
},
]
});
Desired Behavior | per factory & table & column basis Set tristate sorting as a default value for “all” tables and all columns in advance plus having the ability to overwrite the default settings on a per table and per column basis.
let Tabulator = require('tabulator-tables');
// set tristate sorting for the factory object
Tabulator.defaults('headerSortTristate', true);
// or "setting-multiple-defaults-at-once"-syntax
Tabulator.defaults({headerSortTristate: true});
new Tabulator('selector', {
// headerSortTristate is already set to true but can be overwritten per table as well (optional)
data: { k1: 'v1', k2: 'v2' },
columns: [
{
title: 'K1',
field: 'k1',
headerSortTristate: false // overwrite tristate sorting per column (optional)
},
{
title: 'K2',
field: 'k2'
},
]
});
Cheers
Axel 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Column Setup
Use column definitions to configure your columns to display your table ... You can nest column groups, so you can create column groups...
Read more >Setting sort order and visible levels - BMC Documentation
Use the Up and Down buttons to set the sort order of the columns or levels. The field that appears at the top...
Read more >Tabulator'S "Time" Sorter Doesn'T Sort Correctly With Hh: ...
You used to globally set tristate header sorting using the headerSortTristate option var table new Tabulator#exampletable { headerSortTristate:true };.
Read more >Sort data in a table
Custom Sort - sorts data in multiple columns by applying different sort criteria. Here's how to do a custom sort: Select Custom Sort....
Read more >Video: Sort data in a range or table - Microsoft Support
Training: Sort data in Excel quickly, in just a few clicks. To change the order of your data, sort it. To focus on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @Elstermann
I have pushed this to the 4.4 branch which will be released later today
Cheers
Oli 😃
Hey @Elstermann
Thanks for the feedback, i will consider it for addition to the roadmap.
Cheers
Oli 😃