| Submenu Reference ¶ | |
| Hi Mihai, This is Ed, one of your happily licensed users. Is there a way to set a reference from one menu to another. For example, your submenu "Company" from the main tool bar is the same as the submenu "Menu / Company" from the side floating menu. In my case I have a couple of menus which are dynamically generated and can be rather big (I already use the lazy setting). I would like to send the submenu definition only once and then attach it to the second menu bar (perhaps replacing a proxy item) after both menus have been created. An easy solution is, of course, just (1) to do a "copy.innerHTML = original.innerHTML" just before creating both menus, but since my menu can be quite big I was looking for a more efficient solution. (2) A second option would be to clone the original sub menu object and attach the copy to the second "invoker" -- not sure how(?). (3) An even better approach is to just assign a reference of the original submenu after it has been constructed to its second "invoker" -- in this case there would be no copy, both menus would invoke the same submenu instance. I presume this can be done because the popup menus must calculate where to popup anyhow. And also because they get triggered by the parent, so all the information is available to enable a popup menu to have two "invokers"... there is even a good chance that it is just a matter of doing the right assign statement. Is there hope? Can you help? Thanks! | |
| Re: Submenu Reference ¶ | |
| Is there a way to set a reference from one menu to another. Sorry, not at this time, but... For example, your submenu "Company" from the main tool bar is the same as the submenu "Menu / Company" from the side floating menu. In our case it's an workaround. We're cloning the menu UL before passing it to DynarchMenu.setup and thereafter just passing the cloned content again for the left-side menu. You might be right about it being inefficient for large menus. (3) An even better approach is to just assign a reference of the original submenu after it has been constructed to its second "invoker" -- in this case there would be no copy, both menus would invoke the same submenu instance. That's doable and I'll keep it in mind for the next release. Is this feature a big emergency for you? | |
| last |
| Re[2]: Submenu Reference ¶ | |
| We will go live with this version fo the site in late August or early September. It would be great if we had it by then :) | |
| last |
| Re: Submenu Reference ¶ | |
| I investigated the possibility of cloning menus, and the best I could come up with was to allow an easy way to clone a submenu, but however, there will still be 2 menus defined. The nice thing though is that you can easily define it with: <ul id="foo-bar"> The above creates an item having the label “Foo bar” and having the submenu defined by the UL with the ID “foo-bar”. You can clone it as many times you want. The UL doesn't even need to be a descendent of the main menu UL--it can be defined anywhere in your document, possibly for other purposes than being a menu. ;-) It's as fast as if you would have one UL for each menu, though—I mean, the menu elements are duplicated. The current architecture of DynarchMenu does not allow simply using references. I'll release the new code soon and you will be able to upgrade and test it. | |
| last |
| Re[2]: Submenu Reference ¶ | |
| Okay, that beats manually doing the UL innerHTML rewrite. Thanks. :) | |
| last |














