Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#11638 closed enhancement (fixed)

Allow lazy loading of DropDown widgets

Reported by: Arlo White Owned by:
Priority: low Milestone: 1.6
Component: Dijit Version: 1.5
Keywords: DropDownButton Cc: awhite@…
Blocked By: Blocking:

Description

Currently DropDown? widgets must specify a dropDown at creation.

Imagine you have a web application with a hundred DropDownButtons?. Having to instantiate all the TooltipDialogs? just about doubles your load time. This shouldn't be necessary when the user will likely only click a few of the DropDownButtons?.

There should be a way to create a DropDownButton? that creates its dropDown only after it's clicked.

Maybe _HasDropDown should have a createDropDown method that it calls if this.dropDown doesn't exist. Or something along those lines...

This seems like it should be easy enough. There are only two places this.dropDown is referenced:

DropDownButton? references this.dropDown in its startup, this code would need to adjust for the case where dropDown is lazy-loaded.

_HasDropDown references it in toggleDropDown, this is where you would call your createDropDown code if not already created.

Change History (3)

comment:1 Changed 9 years ago by liucougar

Resolution: fixed
Status: newclosed

(In [22770]) fixes #11638: modify DropDownButton? to not assume dropDown is set upon creation of the button.

To lazy-load a dropdown menu, overwrite the default loadDropDown function to create the menu (and populate it) and attach it to this.dropDown

comment:2 Changed 9 years ago by bill

Milestone: tbd1.6

comment:3 Changed 8 years ago by bill

In [26501]:

Backport [22770] (refs #11638 !strict) and also part of [22555], to 1.5, allowing lazy creation of DropDownButton drop down.

Backport [26469], [26500] (refs #13866 !strict) to 1.5, for lazy creation of Editor's foreColor/hiliteColor ColorPalette drop down.

Note: See TracTickets for help on using tickets.