Skip to content

Default sorted column in AnalyticalTable #6383

Answered by Lukas742
SvetoslavZ99 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @SvetoslavZ99

you can use the reactTableOptions.initialState object to achieve this.

      <AnalyticalTable
        {...otherProps}
        reactTableOptions={{
          initialState: {
            columnOrder: ['age', 'name'],
            filters: [{ id: 'age', value: '27' }],
            groupBy: ['age'],
            hiddenColumns: ['name'],
            selectedRowIds: { 2: true, 5: true, '18.3': true },
            sortBy: [
              {
                id: 'age',
                desc: true,
              },
            ], // <-- this is the option you can use
            expanded: {
              '18': true,
              '18.3': true,
            },
          },
        }}
      

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SvetoslavZ99
Comment options

Answer selected by SvetoslavZ99
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants