This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(id?, dependencies?, factory); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* En navnegitt klasse */ | |
var MyClass = declare('MyClass', null, { | |
// Mine funksjoner og properties | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Anonym klasse */ | |
var MyClass = declare(null, { | |
// Mine funksjoner og properties | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Klasse A | |
var A = declare(null, { | |
// Noen properties | |
propertyA: 'Yes', | |
propertyB: 2 | |
}); | |
// Klasse B | |
var B = declare(A, { | |
// Noen properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A: No | |
B: 99 | |
C: true | |
D: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'_MyMixin', | |
'myWidget' | |
], function (_MyMixin, myWidget) | |
{ | |
return declare('my.widget.name', [_MyMixin, myWidget], { | |
myProperty: 'prop', | |
myFunction: function () { | |
console.log('hei hei ' + propertyFromMyWidget); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
... | |
<div data-dojo-type="myWidget"></div> | |
<script> | |
require( | |
['demo/myWidget', | |
'dojo/parser', | |
'dojo/domReady!'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<p>This is from a template.</p> | |
<button data-dojo-type="dijit.form.Button" >My button</button> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'dojo/_base/declare', | |
'dijit/_WidgetBase', | |
'dijit/_TemplatedMixin', | |
'dojo/text!./templates/template.html', | |
'dijit/form/Button' | |
], function (declare, _WidgetBase, _TemplatedMixin, template, button) { | |
return declare('myWidget', [_WidgetBase, _TemplatedMixin], { | |
templateString: template, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Dojo test</title> | |
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/dojo/1.8.1/dijit/themes/claro/claro.css"> | |
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.8.1/dojo/dojo.js" data-dojo-config="isDebug: true, async: true, parseOnLoad: true"></script> | |
</head> | |
<body class="claro"> | |
<h1>This is a template test:</h1> |
OlderNewer