Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

remove item in menu on Android

Hi All,

Please help me.
I created a menu include item1, item2, item3. Then I wanted to remove item1 out menu, but I didn't see any function to remove. What can I do now to remove?

Thanks.

— asked November 5th 2010 by aloha stitch
  • android
0 Comments

3 Answers

  • Your question is quite ambiguous, which is probably why you haven't received any response until now.

    Are you using Titanium.UI.Android.OptionMenu ? If so, using the example at the the bottom of the Android.OptionMenu-module documentation, have you tried simply:

    menu.remove(item2)
    menu.remove(item1)
    

    Cheers

    Hal

    — answered November 5th 2010 by Paul Dowsett
    permalink
    0 Comments
  • Yes, I'm using Titanium.UI.Android.OptionMenu. I tried using menu.remove(item1) but it had error. This error is:

    "TypeError: Cannot call property remove in object ti.modules.titanium.ui.android.optionmenu.Menuproxy@437bcff8. It is not function, it is 'object'"

    — answered November 8th 2010 by aloha stitch
    permalink
    2 Comments
    • Github gist your code please :)

      — commented November 8th 2010 by Paul Dowsett
    • By the way, your response should be in the comments section.

      — commented November 8th 2010 by Paul Dowsett
  • In 1.5.0 there is support coming for remove item. It's not documented yet. Also this old api had to be scrapped so don't pull the CI 1.5.0 until I've documented the menu change.

    — answered December 7th 2010 by Don Thorp
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.