view · edit · sidebar · attach · print · history

20160705-migrate-davaz-com-dojo-to-17

<< 20160706-migrate-davaz-com-dojo-widgets | Index | 20160704-migrate-davaz-com-to-ruby-231 >>


Summary

  • Fix some model issue on Ruby 2.3.1
  • Migrate custom dojo widget to 1.7
  • Migrate dojo Animation

Commits / Patches / Pull Requests, Scripts

Index


Htmlgrid and Dojo

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.

data-dojo-xxx attributes

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

dojo Widget

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

Dojo/Animation is deprecated in 1.7.
Use dojo/fx, but onAnimate callback of animationProperty, does not receive effective value as argument.

view · edit · sidebar · attach · print · history
Page last modified on July 05, 2016, at 06:22 PM