How do I prevent event bubbling in a Titanium Alloy view?
Try:
function doStuff(e){
e.cancelBubble = true;
alert('hello');
}
Suppose you have written this code in xml file:
<View id = “parent” onClick = “parentClicked”>
<ImageView id=“sampleImage” onClick= “childImageClicked”>
</ImageView>
</View>
Then
Try this in TSS :
“#sampleImage” : {
bubbleParent : false,
}
or if you want to do it in Javascript :
function function_name(e){
e.cancelBubble = true;
}
http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Event-property-cancelBubble
I hope this will work for you.