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.

Ability to set/get entire configuration of the table as a single object?

See original GitHub issue

What version of React-Table are you using?

6.7.6

What bug are you experiencing, or what feature are you proposing?

Hi,

I know this table has a capability to export default values for table and override those defaults like this:

import { ReactTableDefaults } from 'react-table'

Object.assign(ReactTableDefaults, {
  defaultPageSize: 10,
  minRows: 3,
  // etc...
})

I also know there’s a possibility of accessing some of the current values (after user changed column width, sorted things, etc…) with provided callbacks

// Callbacks
  onPageChange={(pageIndex) => {...}} // Called when the page index is changed by the user
  onPageSizeChange={(pageSize, pageIndex) => {...}} // Called when the pageSize is changed by the user. The resolve page is also sent to maintain approximate position in the data
  onSortedChange={(newSorted, column, shiftKey) => {...}} // Called when a sortable column header is clicked with the column itself and if the shiftkey was held. If the column is a pivoted column, `column` will be an array of columns
  onExpandedChange={(newExpanded, index, event) => {...}} // Called when an expander is clicked. Use this to manage `expanded`
  onFilteredChange={(column, value) => {...}} // Called when a user enters a value into a filter input field or the value passed to the onFiltersChange handler by the Filter option.
  onResizedChange={(newResized, event) => {...}} // Called when a user clicks on a resizing component (the right edge of a column header)

However, I’d like the ability to be able to get all of the current values in the table, and the ability to send those values back in. Something like getTableConfig/setTableConfig. For example, this would allow people to save entire state of the table, so that people don’t have to constantly sort their tables the way they like. This could also be used to synchronize the data in table with other components on the page, for example charts. If table is only showing first ten rows, the chart could reflect that and show the same rows. If user switches page in table, it could show ten different rows and once again, the chart could reflect that.

With the ability to get current configuration of the table, it allows us to extend the functionality further and it’s also possible to persist all table settings.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

0reactions
jordibujcommented, Sep 24, 2020

The FAQ link above is broken… what would be the recommended way in v7 of saving internal data like column widths?

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - why I am not able to access the get and set method ...
Is there any configuration to do in order use that methods using annotation? please help! java · spring · spring-boot · maven ·...
Read more >
Serial and Remote Racadm Utility Commands
Serial and remote racadm commands set or retrieve object property values ... Allows the user to power-on, power-off, or restart one or all...
Read more >
Property getters and setters - The Modern JavaScript Tutorial
Accessor properties are represented by “getter” and “setter” methods. In an object literal they are denoted by get and set :.
Read more >
Set function in Power Apps - Power Platform - Microsoft Learn
a single value; a record; a table; an object reference; any result from a formula. A global variable holds its value until the...
Read more >
System update sets - Product Documentation | ServiceNow
An update set is a group of configuration changes that can be moved from one instance to another. This feature allows administrators to ......
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