question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Set "headerSortTristate" On Higher Level(s)

See original GitHub issue

Current 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:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
olifolkerdcommented, Aug 11, 2019

Hey @Elstermann

I have pushed this to the 4.4 branch which will be released later today

Cheers

Oli 😃

0reactions
olifolkerdcommented, May 22, 2019

Hey @Elstermann

Thanks for the feedback, i will consider it for addition to the roadmap.

Cheers

Oli 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found