Opened 12 years ago

Closed 12 years ago

#10804 closed defect (invalid)

Dialog: unable to preload internal Grids (>=1.4)

Reported by: Phil DeJarnett Owned by:
Priority: high Milestone: tbd
Component: Dijit Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

dijit.Dialog on 1.3 would hide the dialog by moving it off screen and setting the visibility to "hidden". This allowed complex internal widgets (such as DataGrids) to preload out of sight.

In 1.4, for some reason the postCreate method now sets display to "none". This prevents widgets from being able to be loaded off screen. Grids initialize to a height of 0, for example.

My usual usage:

var d = new dijit.Dialog({ href: someUrl });
// initialize the dialog off-screen

Then the dialog is ready to be shown without the ugly "pop" of widgets being rendered.

I now have to manually change the style, perform the startup, and then revert the style.

Change History (2)

comment:1 Changed 12 years ago by bill

Component: GeneralDijit
Description: modified (diff)
Owner: anonymous deleted
Summary: [Regression] dijit.Dialog in 1.4 is unable preload internal GridsDialog: unable to preload internal Grids (>=1.4)

Yes, Dialog was intentionally changed to initially be display:none, deferring rendering of children until they are shown, thus speeding up initial page load. (Also, if Dialog has an href it shouldn't load the href until the Dialog is shown.) Same thing happens with children TabContainer, AccordionContainer, etc. It's a tradeoff between initial page load time and delays/glitches when displaying new sections of the page.

The grid code was changed so that it acts correctly as a layout widget, specifically that Grid.resize() will layout properly. I assume the issue you are seeing is just a momentary glitch, not a permanent layout problem?

So, I can understand you wanting the old behavior although I wouldn't call this a regression.

Anyway, I need to know more about your use of Dialog. My question is whether the problem you are having is really with waiting for the grid to render, or is it waiting for the data store to download data? I.e. are you using a client side store such as ItemFileReadStore (and if so does it have a URL parameter), or are you using a server store like JsonRestStore?

Also, are the contents of your dialog itself specified via an href or inlined?

I think I could do some stuff to defer the Dialog displaying until it finishes loading but I need to know the exact problem you are having.

comment:2 Changed 12 years ago by bill

Resolution: invalid
Status: newclosed

Closing for lack of info.

Note: See TracTickets for help on using tickets.