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

Edit tree node contents #50

@drkaos

Description

@drkaos

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions