ste cooper
ste cooper

Reputation: 49

appcelerator dynamic forms

i am creating a dynamic order form where you can add a new dropdown and text field into a row. I am using the XML view to create the elements but unlike jQuery, binding the same event to a class and using $('.element', parent) to access elements within a parent, you cant do this as easy with appcelerator as everything seems to use $. and an ID.

does anyone have any solutions for applying one function to multiple elements this way? i know i can bind the event easily but then the event would need to select elements within the selected object. the only way i have done this at the moment is to use a widget but that seems wrong and overkill to create a new instance for just a dropdown.

Many thanks

Upvotes: 1

Views: 99

Answers (1)

Fokke Zandbergen
Fokke Zandbergen

Reputation: 3866

You cannot add listeners to multiple views in one call in Titanium.

Something people do a lot is adding the listener to the parent view and then use the e.source property to determine what actual view triggered the event. This might not work for all use cases.

Upvotes: 1

Related Questions