I have a Custom dojo widget with dojo layout widgets
template as below
<div>
<div data-dojo-type="dijit/layout/BorderContainer" data-dojo-props="gutters:false" id="mainPanel" style="padding: 0px">
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top', splitter:false" style="padding: 0px">
Saartha Labs Pvt Ltd
</div>
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'top', gutters: false, splitter:false" style="padding: 0px" >
<div id="toolBar"></div>
</div>
<div id="map-div" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'center', splitter:false"></div>
<div data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'bottom', splitter:false" style="display: none" ></div>
</div>
</div>
and the Custom Widget as below "Canvas.js"
define([
"dojo/_base/declare",
"dijit/_WidgetBase",
"dijit/_WidgetsInTemplateMixin",
"dijit/_OnDijitClickMixin",
"dijit/_TemplatedMixin",
"dojo/text!./canvas.html",
"dijit/layout/BorderContainer",
"dijit/layout/ContentPane"
], function (declare, _WidgetBase,_WidgetsInTemplateMixin, _OnDijitClickMixin,_TemplatedMixin, template) {
return declare([_WidgetBase,_OnDijitClickMixin, _TemplatedMixin,_WidgetsInTemplateMixin], {
templateString: template
// your custom code goes here
});
});
When use try to use the Canvas with new it throws a error as below.
require([
"bhuvi/canvas/Canvas",
"dojo/domReady!"],
function(Canvas){
var canvas = new Canvas();
canvas.placeAt(window.document.body);
});
Error as
"Tried to register widget with id==mainPanel but that id is already registered"