- Todd -
I have a similar scenario, but the content is available as markup.
Below mentioned approach holds good or is there any finest approach ?!.
Todd Kloots <kloots@...> wrote:Michael -
If you set the "lazyload" configuration property to
"true" for your ContextMenu, then its contents will
not get created and the menu itself will not be
rendered until the "contextmenu" event is actually
That said, if you're creating a ~1000 elements with
unique context menus, then, yes it would be better to
reuse a single ContextMenu instance and reuse it. You
can subscribe to your context menu's "showEvent" and
use the "contextEventTarget " to determine what child
node was the actual target of the "contextmenu" event
that triggered the display of the menu. You can then
use that target element to determine what content you
need to add or remove from the menu.
--- Michael Winston <michaelw@darkhorse. com> wrote:
> Let's say I have 1000 different nodes and each one
> could have a
> custom contextual menu (using YUI Menu, of course).
> I'm a little
> worried about the performance efficiency of building
> 1000 individual
> contextmenus (lazyloaded or not) on the chance a
> user might actually
> want to use one or two of them. This is especially
> true since some
> number of the menus might need to be built with AJAX
> So what I'd like to do is just attach an
> 'oncontextmenu' listener to
> those 1000 nodes that will dynamically build,
> render, and override
> the browser's contextmenu.
> Is this possible and, if so, how?
> If not, it would be great to know that it's
> Yahoo! Groups Links
> (Yahoo! ID required)
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives. Check it out.
- That makes perfect sense and is an absolutely terrific solution. I always forget that I can subscribe to those "interesting moments".Thanks!MichaelOn Jan 30, 2007, at 11:54 AM, Todd Kloots wrote: