Giter Site home page Giter Site logo

Comments (8)

tannerlinsley avatar tannerlinsley commented on August 18, 2024

Try checked={true}
On Fri, Nov 4, 2016 at 10:47 AM Nikolai Hegelstad [email protected]
wrote:

const data = [{
name: 'Tanner Linsley',
age: 26,
friend: {
name: 'Jason Maurer',
age: 23
}
},{
name: 'Banner Dansley',
age: 19,
friend: {
name: 'Jason Mraz',
age: 30
}
}]

const columns = [{
header: 'Name',
accessor: 'name' // String-based value accessors !
}, {
header: 'Age',
accessor: 'age',
render: // Custom cell components!
}, {
header: 'Friend Name',
accessor: 'friend.name' // Custom value accessors!
}, {
header: 'Friend Age',
//header: props => Friend Age, // Custom header components!
accessor: 'friend.age'
}]

Result:

<----- should be rendered as


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#13, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AFUmCf0hqgamysGyzumf3dyNQQgob8-Wks5q62GzgaJpZM4KpwTg
.

from table.

tannerlinsley avatar tannerlinsley commented on August 18, 2024

Then to respond to changes, use onChange={() => {doSomething()}}
On Fri, Nov 4, 2016 at 11:23 AM Tanner Linsley [email protected]
wrote:

Try checked={true}
On Fri, Nov 4, 2016 at 10:47 AM Nikolai Hegelstad <
[email protected]> wrote:

const data = [{
name: 'Tanner Linsley',
age: 26,
friend: {
name: 'Jason Maurer',
age: 23
}
},{
name: 'Banner Dansley',
age: 19,
friend: {
name: 'Jason Mraz',
age: 30
}
}]

const columns = [{
header: 'Name',
accessor: 'name' // String-based value accessors !
}, {
header: 'Age',
accessor: 'age',
render: // Custom cell components!
}, {
header: 'Friend Name',
accessor: 'friend.name' // Custom value accessors!
}, {
header: 'Friend Age',
//header: props => Friend Age, // Custom header components!
accessor: 'friend.age'
}]

Result:

<----- should be rendered as


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#13, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AFUmCf0hqgamysGyzumf3dyNQQgob8-Wks5q62GzgaJpZM4KpwTg
.

from table.

hegelstad avatar hegelstad commented on August 18, 2024

checked={true} doesn't change anything.

What am I supposed to put within:

onChange={(state, instance) => {

                }}

from table.

tannerlinsley avatar tannerlinsley commented on August 18, 2024

That is the callback for when the page and sorting changes. It is an
opportunity for you to fetch server side data. Use it with the 'manual'
prop.
On Sun, Nov 6, 2016 at 9:29 AM Nikolai Hegelstad [email protected]
wrote:

checked={true} doesn't change anything.

What am I supposed to put within:

onChange={(state, instance) => {

            }}


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCYH8m2RaI3RdhiLhYnm4W4sWvzfJks5q7gCHgaJpZM4KpwTg
.

from table.

hegelstad avatar hegelstad commented on August 18, 2024

Aha, I don't think i need to fetch server side data. I just want to be able to check checkboxes within the custom cell component, the checking doesn't have to be persisted across page reloads or component lifecycles, but i would like to be able to access them from the application across paging.

Maybe it is wise to save the state of the checkbox within the data object? Do i change the state with onChange? And would you send me in the right direction to extract custom cell value changes?

from table.

tannerlinsley avatar tannerlinsley commented on August 18, 2024

Yes. In each row of the data, keep a property to track the check box state.
To track changes to the check box, just use an on change on the check box
and update that row.

React Table doesn't track state for anything except paging and sorting. The
rest is up to you. You can use your own components in the header and render
column properties, so you have full control.
On Sun, Nov 6, 2016 at 9:37 AM Nikolai Hegelstad [email protected]
wrote:

Aha, I don't think i need to fetch server side data. I just want to be
able to check checkboxes within the custom cell component, the checking
doesn't have to be persisted across page reloads or component lifecycles,
but i would like to be able to access them from the application across
paging.

Maybe it is wise to save the state of the checkbox within the data object?
Do i change the state with onChange? And would you send me in the right
direction to extract custom cell value changes?


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCVGtif42aThEYxq-QcCztRQsU_1tks5q7gI4gaJpZM4KpwTg
.

from table.

hegelstad avatar hegelstad commented on August 18, 2024

Thanks for taking your time!

from table.

tannerlinsley avatar tannerlinsley commented on August 18, 2024

You bet!
On Sun, Nov 6, 2016 at 9:54 AM Nikolai Hegelstad [email protected]
wrote:

Thanks for taking your time!


You are receiving this because you commented.

Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFUmCUTPsCS_6RWD-e8sAYGEOcxWZt9Jks5q7gYtgaJpZM4KpwTg
.

from table.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.