Renaming menu items
Forums »
General discussion
» Renaming menu items
sadie
Minotaur I.T.
|
2008/05/23 17:19
I'd like to dynamically change the label of a menu item. The documentation for DlMenuItem states:
However, attempting to use this code: var item = new DlMenuItem({ parent: menu, label: "Rename me" }); ... item.label("New name"); Gives me the error "item.label is not a function". Looking at the code with Firebug confirms, label is simply a property (and that it's a DlMenuItem object that i'm looking at). Attempting to set that property with: item.label = "New name"; changes the internal property but not what's displayed on screen. Is the documentation wrong? EDITTurns out I don't need this one urgently. But I am still curious. |
mishoo
Dynarch.com
|
2008/05/24 13:15
Oh, it looks like I missed to add this method... For now you can use setContent instead (note that it won't update the item.label property though): item.setContent("new_label"); DynarchLIB.com |