nativescript-accordion
nativescript-accordion copied to clipboard
how to get parent index when click the child
trafficstars
I'm not able to get parent and child index individually I'm able to get id but when click the child I want to get the parent id.
I want to get parent index when click the child.
There is a tap event emitted when tapping on a child it contains the parent index event.index and the child index event.childIndex
Thank you yeah it was worked perfectly.
Design File
<Accordion class="list-group" [items]="groups"
(itemContentTap)="onItemContentTap($event)">
Ts File
onItemContentTap(event) {
const data = event.data;
console.log(event.index);
console.log(event.childIndex); // Index is always one more than what user taps
console.log(data);
}
Child Index returns wrong Value