Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Change MenuItem dynamically

$
0
0

I have a comment text area form and an android MenuItem (postComment). when the user enters a certain amount of characters, the menu item should be touchEnabled and have a different color.

i dont really understand how to target/dynmiacally change the individual menu items in alloy (and sdk 3.5.1). i looked http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Android.Menu and here https://gist.github.com/FokkeZB/6686175 but i still dont really grasp it. i guess i have to use the activity.invalidateOptionsMenu() somehow for changes after creation?

comment.xml

<Menu id="menu" platform="android">
     <MenuItem id="postComment" title="Send" onClick="send"/>
</Menu>
for instance, i tried unsuccessfully things like this in comment.js
$.postComment.visible = false
thx for any wise words!

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>