Opened 10 years ago
Closed 5 years ago
#11989 closed defect (patchwelcome)
_Templated: call resize() on _supportingWidgets
Reported by: | Remoun Metyas | Owned by: | |
---|---|---|---|
Priority: | high | Milestone: | 1.13 |
Component: | Dijit | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Related to #11988.
Patch attached.
Attachments (3)
Change History (11)
Changed 10 years ago by
Attachment: | _Templated.onHide.patch added |
---|
comment:1 Changed 10 years ago by
Hi rem, thanks for the patch, not sure who you are though, does you or your company have a CLA?
comment:2 Changed 10 years ago by
Also, this requires some thought, because true child widgets (like inside a Dialog.containerNode) are also not notified on onShow().
The general approach for widgets that need to do something when they are shown is that the parent calls resize() on them. IIRC that's already happening for supportingWidgets and true child widgets.
comment:3 Changed 10 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Closing because of no CLA and because it's unclear if this change makes sense (see above comment).
comment:4 Changed 10 years ago by
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
Hi bill, sorry I didn't reply sooner; I didn't get any notifications (I somehow missed the Trac Preferences, so neither my name nor email were set.. D'oh!).
I'll sign the CLA and send it ASAP.
I thought this was related to #11991, but I was mistaken. I just tried a TabContainer? with a DataGrid? and the same DataGrid? inside a _Templated widget, and the latter is the only one that doesn't update. As per your suggestion, I tried making the _Templated widget call resize() for its _supportingWidgets, and that makes the grid render. I'm attaching a test case that demonstrates this.
I guess there's no immediate need for _onShow/onHide to be called on _supportingWidgets, but I (still) think it sounds right.
NB: the test file assumes top-level dojo/ dir is a sibling (with dijit, dojo, dojox subdirs underneath); adapted from dojox/grid/tests/test_grid_tab_container.html
comment:5 Changed 10 years ago by
Milestone: | tbd → future |
---|---|
Summary: | _Templated doesn't notify its _supportingWidgets onHide/_onShow → _Templated: call resize() on _supportingWidgets |
I'll look into this.
_Templated already calls startup() on the supporting widgets, and for any supporting widget S which is a layout widget, S.startup() willl call S.resize(), unless S's parent is a layout container. So, _Templated should only call resize() on the children in certain cases.
comment:6 Changed 10 years ago by
FWIW, a quick look at the _Templated layout widgets (in dijit.layout and dojox.layout), and they either override resize() [without calling this.inherited] and/or don't have any widgetsInTemplate.
To make it more solid, perhaps _Templated's impl just needs to check if(!this.isLayoutContainer)
?
Changed 10 years ago by
Attachment: | _Templated.resize.patch added |
---|
comment:8 Changed 5 years ago by
Milestone: | future → 1.12 |
---|---|
Resolution: | → patchwelcome |
Status: | reopened → closed |
This would unfortunately need to be revisited given that the patch has sat around for 5 years. If there's still interest in this, please create a new pull request and we'll consider for 1.12. Closing as patchwelcome for now.
Make _Templated channel onHide/_onShow to its _supportingWidgets