<< 20160706-migrate-davaz-com-dojo-widgets | Index | 20160704-migrate-davaz-com-to-ruby-231 >>
Today, I have to migrate syntax of many javascript files on davaz.com, to Dojo 1.7.
# Current davaz.com uses 0.3.0
So I've installed Dojo docs into my devdocs server on local machine.
Dojo's reference guide is also helpful to me.
New Dojo says non-standard HTML attributes is deprecated.
z.B. <div eventUrls="http://xxx, http://xxx, ..." foo="bar">
We have to pass argments and properties with data-dojo-props/data-dojo-args attributes to widgets.
http://dojotoolkit.org/reference-guide/1.7/dojo/parser.html
I've created minimum templated custom widget to make sure, how it works.
<div data-dojo-type="FooWidget"></div>
define([ 'dojo/_base/declare', 'dojo/ready', 'dojo/parser', 'dojo/dom-construct', 'dijit/_WidgetBase', 'dijit/_TemplatedMixin' ], function(declare, ready, parser, query, domConstruct, _WidgetBase, _TemplatedMixin) { declare('FooWidget', [_WidgetBase, _TemplatedMixin], { //buildRendering: function() { // console.log('RENDER!'); // this.domNode = domConstruct.create("button", {innerHTML: "push me"}); //}, templateString: "<h1>TEMPLATE!</h1>", constructor: function(params, srcNodeRef) { console.log('CONSTRUCT!'); console.log(params); } }); ready(function() { console.log('PARSE!'); parser.parse(); }); });
then, I've found some errors, in current code.
Finally, Dojo widget works, expectedly.
Dojo/Animation is deprecated in 1.7.
Use dojo/fx, but onAnimate
callback of animationProperty, does not receive effective value as argument.