Loading ...
Sorry, an error occurred while loading the content.

Re: Application Style Menu Bar issues

Expand Messages
  • allanbjork
    ... menus ... toggling ... items ... Removing items this way does work, but you have to always delete the element from itemData, even if getItems followed by a
    Message 1 of 6 , Oct 10, 2007
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "allanbjork" <abjork@...>
      wrote:
      >
      > Ok, I figured this out.
      >
      > If a call to getItems returned a zero length array, I would need to
      > operate directly on the itemData array. (Is that because the menus
      > were marked lazyLoad:true?)
      >
      > By directly manipulating the itemData array, I could modify my
      menus
      > after doing my database queries. (At least adding items, and
      toggling
      > the disable flag work. Still writing the code to try removing
      items
      > from the menus.)
      >


      Removing items this way does work, but you have to always delete
      the element from itemData, even if getItems followed by a call to
      removeItem works. Otherwise, once removeItem pulls the last menu
      entry off, the menu will get repopulated with the data present in
      itemData.

      YUI devs: could I suggest that a future version of the menu, be
      adjusted so that it when getItems/addItem/removeItem/etc. are called
      it simultaneously adjusts itemData as well? I think that would be
      more logical, and intuitive behaviour to YUI application developers.
      (And would also make my code a lot cleaner. ;-) )
    Your message has been successfully submitted and would be delivered to recipients shortly.