Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Edit tree node contents #50

Open
drkaos opened this issue Jul 19, 2018 · 0 comments
Open

Edit tree node contents #50

drkaos opened this issue Jul 19, 2018 · 0 comments

Comments

@drkaos
Copy link

drkaos commented Jul 19, 2018

I am using the display prop to render custom text and display an "edit" button in react. i am passing the object passed to the display function to the onClick handler of the button to be used for editing. is the object passed to the display function the actual object from within the original tree model? i.e. if I update the passed object am i updating the original data? If not, how could I programmatically delete and add a new node with the updated content? or update and render the original data?

    mainTreeProps = {
        ...this.treeProps, display: d => <div><Button onClick={() => {
            d.items ? this.props.EditGroup(d) : this.props.EditItem(d);
        }}>Edit</Button>{d.name}</div>
    };

(i.e. is "d" a copy or a reference to the object in the original model / object)

@drkaos drkaos changed the title How do I update tree contents Can I edit tree node contents Jul 19, 2018
@drkaos drkaos changed the title Can I edit tree node contents Edit tree node contents Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant