Hi, I am new to react.js. Please help me. I create a treeview control using react.js from XML file. On page load, its showing two main parent nodes only (Collapse plus image). Clicking on + or node click expand node. Parent node will have minus image. All the nodes having children who are expanded will have minus image.
Collapse nodes plus image
expand nodes having child will have minus image.
last node will have paper image.
Please find the code in the attachment with the images and tree.gif displays how tree looks like.
Please modify the code, how to use images. Currently it's showing unordered list.
Thanks for all the help.
Thanks Keerthana.
I looked the links and demo that you provided. I am still not sure how to make the changes in my react code.
Please modify the code I provided. Its unordered list. In place of unordered list, I want plus, minus and paper images.
plus image for collapse, minus for expand and paper is for the last node .
Thanks
export class Default extends SampleBase {
constructor() {
super(...arguments);
this.data = dataSource;
this.fields = {
dataSource: this.data.defaultData,
id: "id",
text: "name",
child: "subChild"
};
this.style = "custom";
}
render() {
return (
<div className="control-pane">
<div className="control-section">
<div className="tree-control_wrapper">
<TreeViewComponent fields={this.fields} cssClass={this.style} />
</div>
</div>
</div>
);
}
} |
.custom.e-treeview .e-list-item .e-icon-expandable::before {
content: '\e556';
font-size: 13px;
}
.custom.e-treeview .e-list-item .e-icon-collapsible::before {
content: '\e554';
font-size: 13px;
} |