Reputation: 35
Can we create dojo declarative titlePane inside template based widget?
When I am creating a titlePane out side the template file like :
It is working, but as soon as I have moved this code to html template file it is not working. (I am attachiong this file to dojo widget)
Upvotes: 0
Views: 271
Reputation: 44665
You should be able to add widgets in your template yes. There are only a few things you have to remind:
dijit/_WidgetsInTemplateMixin
as well,dijit/TitlePane
), by adding it either to your require()
or define()
.
For example:declare("my/Widget", [ _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin ], {
title: "My title",
content: "My content",
templateString: "<div>" +
"<div data-dojo-type=\"dijit/TitlePane\" data-dojo-props=\"title: '${title}'\">${content}</div>" +
"</div>"
});
I also made an example JSFiddle.
Upvotes: 1