Refer the parent of the element in NS core


I want a reference to the parent of the clicked element.

<StackLayout id="1"> <Label tap="tapped" /> </StackLayout>

When I click on Label I want a reference to StackLayout(it’s parent).How can I do that in NS-core ?


Add an id property to the Label and grab the view by id in the associated class. Then you should be able to read the parent property of the element.


<Label id="myLabel">

.js / .ts:

page.getViewById("myLabel").parent // this is the StackLayout