Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Widgets in template #154

Closed
davewilton opened this issue Mar 16, 2020 · 3 comments
Closed

Widgets in template #154

davewilton opened this issue Mar 16, 2020 · 3 comments

Comments

@davewilton
Copy link
Contributor

davewilton commented Mar 16, 2020

Just spent an hour scratching my head on this one. If you add templated widgets to your html e.g.

auto;">
    <div data-dojo-type="dijit/layout/AccordionPane" title="pane #1">accordion pane #1</div>
    <div data-dojo-type="dijit/layout/AccordionPane" title="pane #2">accordion pane #2</div>
    <div data-dojo-type="dijit/layout/AccordionPane" title="pane #3">accordion pane #3</div>
</div>

You both need to mix in the template:

@declare(BaseWidget, _WidgetsInTemplateMixin)
class Widget implements IWidget {

AND call the startup of _WidgetsInTemplateMixin

 public startup(args: any): void {
    BaseWidget.prototype.startup.call(this, args);
    _WidgetsInTemplateMixin.prototype.startup.call(this, args);

Another option is not to use strict mode in your tsconfig "noImplicitUseStrict": true which then allows:

 public startup(args: any): void {
    var self: any = this;
    this.inherited(arguments);

This should probably be added to the documentation (easiest) or we add a new option "will your widget contain templated dojo widgets" which stubs this out

@gavinr
Copy link
Contributor

gavinr commented Mar 18, 2020

@davewilton thank you for this - I will propose a change to the documentation that notes this.

@gavinr
Copy link
Contributor

gavinr commented Mar 18, 2020

@davewilton do you think the changes proposed in #155 covers it well enough?

@davewilton
Copy link
Contributor Author

@gavinr yes looks good

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants