Comments (10)
I'm not sure I understand the columns={columns} jsx you have in the
callback?
On Thu, Oct 27, 2016 at 4:57 PM Alex Simoes [email protected]
wrote:
I'm trying to use the server-side data example which will work until I add
a setTimeout and then I get a few console errors. Here's the sample code:Works --
const data = [{name:'test', id:1234}];return (
{ callback({ rows:data }) }} />)Doesn't work --
const data = [{name:'test', id:1234}];return (
{ setTimeout(() => { callback({ rows:data }) }) }} />)The second test will work if initialized with the callback like so:
const data = [{name:'test', id:1234}];return (
{ columns={columns} setTimeout(() => { callback({ rows:data }) }) }} />)—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AFUmCZXkljtUZiUcMIEKdF62S6JAL4K4ks5q4SxVgaJpZM4Ki6ap
.
from table.
Woops, sorry that was a copy/paste error, the last, working example should've been this:
const data = [{name:'test', id:1234}];
return (
<div>
<ReactTable
pageSize={10}
columns={columns}
data={(params, callback) => {
callback({ rows:[] })
setTimeout(() => {
callback({ rows:data })
})
}}
/>
</div>
)
from table.
I'll look into this tomorrow. Very interesting
On Fri, Oct 28, 2016 at 10:34 AM Alex Simoes [email protected]
wrote:
Woops, sorry that was a copy/paste error, the last, working example
should've been this:const data = [{name:'test', id:1234}];return (
){
callback({ rows:[] })setTimeout(() => {
callback({ rows:data })
})
}}
/>—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#6 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCdX3qElFwND8YDEwjdzJMa4LD6hDks5q4iQfgaJpZM4Ki6ap
.
from table.
I can confirm, I'm running into the same issue as well.
Additionally, the page
property seems to get all out of whack. Pages one and two pass me 1, while page three passes me 2.
from table.
Just released 3.0.0. Did you have a look at the new server side section?
On Mon, Oct 31, 2016 at 1:54 AM Nicholas Paldino [email protected]
wrote:
I can confirm, I'm running into the same issue as well.
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#6 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCSaj8g8GXNj4qAZCI6P-QzXeoe9Nks5q5Z7CgaJpZM4Ki6ap
.
from table.
The way data is fetched in the latest version should fix this issue. You can now listen for table changes and handle the data updates yourself via component state or redux or any other dynamic react state.
from table.
The way data is fetched in the latest version should fix this issue. You can now listen for table changes and handle the data updates yourself via component state or redux or any other dynamic react state.
Do you have an example of this?
When using a callback, I'm getting this.props.data.map
is not a function:
In this case, this.props.data
is the callback function.
Here's the code that I have for react-table:
<ReactTable
data={ (params, callback) => {
// If no URL, then just get out.
if (!challongeUrl) return Promise.resolve({ rows: [] });
return fetchUtilities.fetchApi({
url: `/api/challonge/tournaments?url=${ encodeURIComponent(challongeUrl) }&page=${ params.page }`
}).then(data => {
return {
pages: data.pages,
rows: data.tournaments
}
})
}
}
columns={[
{
accessor: 'name',
name: 'Name'
},
{
accessor: 'game',
name: 'Game'
},
{
accessor: 'type',
name: 'Bracket Type'
},
{
accessor: 'progress',
name: '% Complete',
render: ({ value, rowValues, row, index, viewIndex}) => <LinearProgress mode='determinate' value={ value }/>
}
]}
/>
I've validated that my service is returning the data correctly.
from table.
Update to the latest version and follow these steps
https://github.com/tannerlinsley/react-table/#server-side-data
On Mon, Oct 31, 2016 at 2:25 AM Nicholas Paldino [email protected]
wrote:
The way data is fetched in the latest version should fix this issue. You
can now listen for table changes and handle the data updates yourself via
component state or redux or any other dynamic react state.Do you have an example of this?
When using a callback, I'm getting this.props.data.map is not a function:
[image: image]
https://cloud.githubusercontent.com/assets/561862/19848138/cf43d398-9f21-11e6-9b4e-147545454371.pngIn this case, this.props.data is the callback function.
Here's the code that I have for react-table:
<ReactTable
data={ (params, callback) => {
// If no URL, then just get out.
if (!challongeUrl) return Promise.resolve({ rows: [] });return fetchUtilities.fetchApi({ url: `/api/challonge/tournaments?url=${ encodeURIComponent(challongeUrl) }&page=${ params.page }` }).then(data => { return { pages: data.pages, rows: data.tournaments } }) }
}
columns={[
{
accessor: 'name',
name: 'Name'
},
{
accessor: 'game',
name: 'Game'
},
{
accessor: 'type',
name: 'Bracket Type'
},
{
accessor: 'progress',
name: '% Complete',
render: ({ value, rowValues, row, index, viewIndex}) => <LinearProgress mode='determinate' value={ value }/>
}
]}
/>I've validated that my service is returning the data correctly.
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#6 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCcnbjaiI19Gjidr-jKyB6CYGYrLtks5q5aX4gaJpZM4Ki6ap
.
from table.
That seems to do it, thanks!
I'm having an issue where all the data is being rendered as  
but that's for me to figure out another day.
from table.
@casperOne If minRows
is set to anything > 0, placeholder rows are inserted into the table that contain
. My guess is your data
is empty or something similar. If you still have that problem, create a new issue and we'll handle it there :)
from table.
Related Issues (20)
- The `FiltersTableState` type is no longer exported after PR #5413, It's a breaking change. HOT 1
- Examples for svelte in documentation page not working HOT 1
- AccessorFnColumnDefBase not being exported, causes type error with an array of columns defined by columnHelper HOT 1
- Pagination state in endless loop HOT 2
- `useQwikTable(options)` causes vite to crash in dev mode HOT 5
- Table refreshes when i check a checkbox HOT 2
- autoResetPageIndex not resetting properly HOT 2
- How to add onClick with useState hook in cell. Error re-renders because of getRowModel()
- [Vue warn]: Invalid VNode type: Symbol(react.fragment) (symbol)
- Column Virtualisation is not working in case we have grouped columns
- "regeneratorRuntime is not defined" error in documentation example
- hello world example gives multiple errors, starting with "Can't resolve 'crypto' "
- createColumnHelper's DeepKeys fails to properly resolve keys for accessor
- Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length') at getFacetedUniqueValues.ts:20:38
- Filters are not working with react table infinitescrolling HOT 1
- getVisibleLeafColumns The header of the getVisiBleleafColumns column is misaligned when the groups configuration is included
- Column visibility APIs do not work with column groups
- sortingFn: 'alphanumeric' returns numbers last HOT 1
- Site not loading HOT 10
- your website is down HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from table.