Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added optional id for creation of TitlePane and Floating Widgets. #66

Closed
wants to merge 1 commit into from
Closed

Added optional id for creation of TitlePane and Floating Widgets. #66

wants to merge 1 commit into from

Conversation

tmcgee
Copy link
Member

@tmcgee tmcgee commented Jun 3, 2014

This id allows styling the individual widgets using CSS to add an icon on the TitleBar, for example:

#sidebar_Print .dijitTitlePaneTextNode {
    background-image: url('../js/gis/dijit/Print/images/print.png');
    background-repeat: no-repeat;
    background-position: 0px 2px;
    padding-left: 21px;
}

This can also be used to interact with the widgets using code via the widgetid and id attributes.

…s allows styling the individual widgets using CSS to add an icon on the TitleBar for example. You can also programmatically control of the widgets (open/close/etc) from code.
@rogers259
Copy link

@tmcgee
Would this allow for grouping widgets under one dropdown? Looking to de-clutter the side bar a bit by grouping widgets (like Draw & Measure under one TP).

Nice upgrade BTW!

@DavidSpriggs
Copy link
Member

@rogers259 This will not allow for grouping. If you want to combine widgets into one title pane, you would do this by writing a widget class that wraps the two widgets and loads then into the same title pane.

@tmcgee
Copy link
Member Author

tmcgee commented Jun 5, 2014

As David noted, this doesn't do that as written. I can see it being extended to use the id of an existing TitleBar widget. This would be adding a couple lines of code to _createTitlePaneWidget to check for a pre-existing TitleBar widget. However...

The problem with this approach is due to the async nature of AMD, you are not in absolute control of the position of your widget within the parent TitleBar. A quick test with draw and measure showed me that the order was inconsistent (the draw widget sometimes was displayed above the measure widget while other times it was the reverse). Re-writing the function as David mentioned to include both widgets wrapped within a single requires would allow that control.

@DavidSpriggs
Copy link
Member

Closing this PR as this will be baked into the new widget loader.

@rogers259
Copy link

Was this feature lost with the upgrade to the new widget loader?

@tmcgee
Copy link
Member Author

tmcgee commented Jun 9, 2014

@rogers259 I believe you are correct and this feature is currently missing.

The id has been added for each widget in the new config object structure though the id is not being utilized when creating a TitleBar widget. I haven't yet fully examined David's changes. Once I have, I will create a new PR if needed.

@DavidSpriggs
Copy link
Member

Ahh, I did forget to pass the id down the line, my bad. I will fix unless someone else PR's it first ;)

@tmcgee tmcgee deleted the add-widget-ids branch June 14, 2014 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants