Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Column headers hidden when dgrid is placed in dijit/Dialog #268

Closed
EToreo opened this Issue · 3 comments

3 participants

@EToreo

Here is a gist with the reproduction: https://gist.github.com/3501893

If you change it so the content pane is attached to the window body instead of a dijit/Dialog, the column headers show up fine.

@deanpeterson

Something similar occurs for me as well. When I place the grid inside a dojo drop down button, the headers do not appear.

@kfranqueiro
Collaborator

You're calling startup on the grid (and the popup) before it's actually in flow. Call the grid's startup method after calling popup.show and it will probably be fine.

The startup method is specifically the point in the widget lifecycle where any logic is performed that is dependent on the component's DOM being displayed in the document (e.g. anything relying on rendered size of DOM nodes). Thus, it is important that startup only be called after the widget is actually rendered in the document flow; this is why it needs to be called manually when instantiating dijit widgets or dgrid instances programmatically (since there's no way for JavaScript to determine when the DOM suddenly becomes attached to the document and is actually displayed).

One exception to this rule is that dgrid components will attempt to automatically call startup for you if they can determine that they are already in flow immediately upon creation.

(Edit) I might add that you may also get better results in your cases if you mix in the DijitRegistry dgrid extension; see the first sub-heading under https://github.com/SitePen/dgrid/wiki/Working-with-Widgets for more info.

@kfranqueiro
Collaborator

Given this issue received no further response, I'm closing it, since I believe that the premature call to startup was the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.