I have three layer object: there is several departments, Department have multiple categories and category have multiple subCategories:
I am using [checkBy]="checkBy" in html page
Html code of tree view:
and methods in ts file
public checkBy(item: TreeItem) {
return item.dataItem;
}
public handleProductChecking(checkedKeys: any): void {
//checkedKeys coming as object - that as per my requirement
}
if I removed the [checkBy]="checkBy"
from html than parent coming checked when i checking any child item but handleProductChecking
returns the array of indexes like [0_1_2] while I need object for my requirement,
conclusion of my requiremnt is - parent should be checked(with hypen) when I checked in any child and handleProductChecking
return the object rather than array of indexes.