Hi Lahari,
Greetings from Syncfusion support.
Query 1 : Need to disable selecting parent
you can disable the selection of certain items in a Dropdown
Tree component by setting the e-disable class in the
dataSource using htmlAttributes for
specific nodes. Here, we disabled the first level parent nodes in the
Dropdown Tree datasource. You can also achieve your requirement by passing the
node id’s in a array format to disableNodes
method of TreeView inside the select
event of Dropdown Tree component.
Check out the below mentioned code snippets for your
reference.
[app.component.html]
<ejs-dropdowntree #sample id="default" ... (select)="onSelect($event)"
[fields]="fields"></ejs-dropdowntree>
[app.component.ts]
public hierarchicalData: Object[] = [
{
id: '01',
name: 'Local Disk (C:)',
htmlAttributes: { class: 'e-disable' },
...
},
{
id: '02',
name: 'Local Disk (D:)',
htmlAttributes: { class: 'e-disable' },
subChild: [
{
id: '02-01',
name: 'Personals',
subChild: [
{ id: '02-01-01', name: 'My photo.png' },
{ id: '02-01-02', name: 'Rental document.docx'
},
{ id: '02-01-03', name: 'Pay slip.pdf' },
],
},
...
],
},
];
public onSelect(args) {
this.ddTree.treeObj.disableNodes([args.itemData.id]);
}
|
Query 2 : After saving the data while opening we need
to set already saved value how can we do that.
We are
quite unclear about the exact requirement in the Dropdown Tree component. We
would like to confirm whether you want to retrieve the data after editing of
the tree nodes or whether you need to get the initially rendered Dropdown Tree
datasource. Confirm the above details or share some additional
information. It will help us further validate the reported requirement from our
side.