Parse on load add using declaratively ChildWidget.

This commit is contained in:
Tomasz Półgrabia 2021-12-19 15:05:22 +01:00
parent 1a2b04bd6c
commit 4407cd934d
5 changed files with 31 additions and 15 deletions

View file

@ -1,10 +1,16 @@
define([
"dijit/_TemplatedMixin",
"dijit/_AttachMixin",
"dijit/_WidgetBase",
"dojo/_base/declare",
"dojo/text!./MainWidget.html"
], function(_TemplatedMixin, _WidgetBase, declare, template) {
return declare("app/widgets/MainWidget", [_WidgetBase, _TemplatedMixin], {
templateString: template
"dojo/_base/declare"
], function(_TemplatedMixin, _AttachMixin, _WidgetBase, declare, template) {
return declare("app/widgets/MainWidget", [_WidgetBase, _AttachMixin, _TemplatedMixin], {
templateString: "<div>"
// + "Hello World!!! <input data-dojo-type=\"dijit/form/TextBox\" />"
// this works as it's dijit
+ "<div data-dojo-type=\"./ChildWidget\"></div>"
// this doesn't work as it's trying to fetch ./node_modules/dojo/ChildWidget which seems to be
// relative to dojo/parser dojo/parser
+ "</div>"
});
});