Nested dojo widgets do not work

I created a very simple template widget. Something like that:

function (declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, ..., ...) {
    return declare("widgets.some.Widget", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {..

   ...
   templateString: template,
   widgetsInTemplate: true,
   ...
}

These widgets load and work fine. However, when I want to use it in another widget template, for example:

<div style="width: 400px" data-dojo-type="widgets.some.Widget" ... >
</div>

.. As a result, I get 2 errors:

Unable to read 'nodeType' property from null "

and

widgets.somewidgetusing.SomeWidget: the parser returned an empty promise (probably waiting for the module to load automatically), unsupported _WidgetsInTemplateMixin. Before creating an instance, you must first load all supporting widgets.

Both widgets work fine, but when I use widgets.some.Widgetin another widget, errors occur.

+4
source share
1 answer

. html-. . . Some.Widget html id="Text1". .

+5

Source: https://habr.com/ru/post/1526056/


All Articles