-
Notifications
You must be signed in to change notification settings - Fork 0
/
SomeWidget.js
46 lines (41 loc) · 1.4 KB
/
SomeWidget.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
define([
"dojo/_base/declare",
"dijit/_WidgetBase",
// "dijit/_OnDijitClickMixin",
"dijit/_TemplatedMixin",
'dijit/_WidgetsInTemplateMixin',
"dojo/text!./demo/templates/SomeWidget.html"
],function(declare, _WidgetBase, /*_OnDijitClickMixin,*/ _TemplatedMixin,_WidgetsInTemplateMixin, template){
return declare( [_WidgetBase, /* _OnDijitClickMixin,*/ _TemplatedMixin,_WidgetsInTemplateMixin], {
// set our template
templateString: template,
// some properties
// baseClass: "someWidget",
title: "", // we'll set this from the widget def
// hidden counter
_counter: 1,
_firstClicked: false,
// define an onClick handler
_onClick: function(){
if(this._firstClicked){
this.titleNode.innerHTML = this.title + " was clicked " + (++this._counter) + " times.";
} else {
this.titleNode.innerHTML = this.title + " was clicked!";
this._firstClicked = true;
}
},
_btnOnClick:function(){
alert("button click");
},
_sOnClick:function(){
alert("in dijitButton");
this.dijiButton.innerHTML="hello";
},
testFunc:function(){
alert("exe test");
},
postCreate: function(){
this.titleNode.innerHTML = this.title;
}
});
});