Dojo demo2 - how not to use placeAt / place methods in dojo toolkit.

This commit is contained in:
Tomasz Półgrabia 2021-09-30 21:17:01 +02:00
parent 313747938e
commit 4dd5fa2b15
5 changed files with 92 additions and 0 deletions

View file

@ -0,0 +1,26 @@
define([
'dojo/_base/declare',
'dojo/dom-construct',
'dijit/_WidgetBase',
'dijit/_TemplatedMixin',
'dojo/text!widgets/SimpleWidget.html'
], function(declare, domConstruct, _WidgetBase, _TemplatedMixin, template) {
return declare([_WidgetBase, _TemplatedMixin], {
templateString: template,
constructor: function(props) {
this._idx = 0;
},
postCreate: function() {
this.inherited(arguments);
},
clickMeHandle: function() {
console.log('Click me handle');
var item = domConstruct.create('div', { innerHTML: this._idx++ });
domConstruct.place(item, this.point, 'only');
}
});
});