dojox/dtl/contrib/dijit.js

  • Provides:

    • dojox.dtl.contrib.dijit
  • Requires:

    • dojox.dtl.dom in common
    • dojo.parser in common in project dojo
  • dojox.dtl.contrib.dijit.AttachNode

    • type
      Function
    • parameters:
      • keys: (typeof )
      • object: (typeof )
    • source: [view]
        this._keys = keys;
        this._object = object;
    • summary
  • dojox.dtl.contrib.dijit.EventNode

    • type
      Function
    • parameters:
      • command: (typeof )
      • obj: (typeof )
    • source: [view]
        this._command = command;


        var type, events = command.split(/\s*,\s*/);
        var trim = dojo.trim;
        var types = [];
        var fns = [];
        while(type = events.pop()){
         if(type){
          var fn = null;
          if(type.indexOf(":") != -1){
           // oh, if only JS had tuple assignment
           var funcNameArr = type.split(":");
           type = trim(funcNameArr[0]);
           fn = trim(funcNameArr.slice(1).join(":"));
          }else{
           type = trim(type);
          }
          if(!fn){
           fn = type;
          }
          types.push(type);
          fns.push(fn);
         }
        }


        this._types = types;
        this._fns = fns;
        this._object = obj;
        this._rendered = [];
    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode

    • type
      Function
    • parameters:
      • node: (typeof )
      • parsed: (typeof )
    • source: [view]
        this._node = node;
        this._parsed = parsed;


        var events = node.getAttribute("dojoAttachEvent");
        if(events){
         this._events = new ddcd.EventNode(dojo.trim(events));
        }
        var attach = node.getAttribute("dojoAttachPoint");
        if(attach){
         this._attach = new ddcd.AttachNode(dojo.trim(attach).split(/\s*,\s*/));
        }


        if (!parsed){
         this._dijit = dojo.parser.instantiate([cloneNode(node)])[0];
        }else{
         node = cloneNode(node);
         var old = ddcd.widgetsInTemplate;
         ddcd.widgetsInTemplate = false;
         this._template = new dd.DomTemplate(node);
         ddcd.widgetsInTemplate = old;
        }
    • summary
  • dojox.dtl.contrib.dijit.AttachNode._keys

    • summary
  • dojox.dtl.contrib.dijit.AttachNode._object

    • summary
  • dojox.dtl.contrib.dijit.AttachNode.render

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         if(!this._rendered){
          this._rendered = true;
          for(var i=0, key; key = this._keys[i]; i++){
           context.getThis()[key] = this._object || buffer.getParent();
          }
         }
         return buffer;
    • summary
  • dojox.dtl.contrib.dijit.AttachNode._rendered

    • summary
  • dojox.dtl.contrib.dijit.AttachNode.unrender

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         if(this._rendered){
          this._rendered = false;
          for(var i=0, key; key = this._keys[i]; i++){
           if(context.getThis()[key] === (this._object || buffer.getParent())){
            delete context.getThis()[key];
           }
          }
         }
         return buffer;
    • summary
  • dojox.dtl.contrib.dijit.AttachNode.clone

    • type
      Function
    • parameters:
      • buffer: (typeof )
    • source: [view]
         return new this.constructor(this._keys, this._object);
    • summary
  • dojox.dtl.contrib.dijit.EventNode._command

    • summary
  • dojox.dtl.contrib.dijit.EventNode._types

    • summary
  • dojox.dtl.contrib.dijit.EventNode._fns

    • summary
  • dojox.dtl.contrib.dijit.EventNode._object

    • summary
  • dojox.dtl.contrib.dijit.EventNode._rendered

    • summary
  • dojox.dtl.contrib.dijit.EventNode._clear

    • summary
  • dojox.dtl.contrib.dijit.EventNode.render

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         for(var i = 0, type; type = this._types[i]; i++){
          if(!this._clear && !this._object){
           buffer.getParent()[type] = null;
          }
          var fn = this._fns[i];
          var args;
          if(fn.indexOf(" ") != -1){
           if(this._rendered[i]){
            dojo.disconnect(this._rendered[i]);
            this._rendered[i] = false;
           }
           args = dojo.map(fn.split(" ").slice(1), function(item){
            return new dd._Filter(item).resolve(context);
           });
           fn = fn.split(" ", 2)[0];
          }
          if(!this._rendered[i]){
           if(!this._object){
            this._rendered[i] = buffer.addEvent(context, type, fn, args);
           }else{
            this._rendered[i] = dojo.connect(this._object, type, context.getThis(), fn);
           }
          }
         }
         this._clear = true;


         return buffer;
    • summary
  • dojox.dtl.contrib.dijit.EventNode.unrender

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         while(this._rendered.length){
          dojo.disconnect(this._rendered.pop());
         }
         return buffer;
    • summary
  • dojox.dtl.contrib.dijit.EventNode.clone

    • type
      Function
    • source: [view]
         return new this.constructor(this._command, this._object);
    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._node

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._parsed

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._events

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._attach

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._dijit

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._template

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode.render

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         if(this._parsed){
          var _buffer = new dd.DomBuffer();
          this._template.render(context, _buffer);
          var root = cloneNode(_buffer.getRootNode());
          var div = document.createElement("div");
          div.appendChild(root);
          var rendered = div.innerHTML;
          div.removeChild(root);
          if(rendered != this._rendered){
           this._rendered = rendered;
           if(this._dijit){
            this._dijit.destroyRecursive();
           }
           this._dijit = dojo.parser.instantiate([root])[0];
          }
         }


         var node = this._dijit.domNode;


         if(this._events){
          this._events._object = this._dijit;
          this._events.render(context, buffer);
         }
         if(this._attach){
          this._attach._object = this._dijit;
          this._attach.render(context, buffer);
         }


         return buffer.concat(node);
    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._rendered

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._events._object

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode._attach._object

    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode.unrender

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         return buffer.remove(this._dijit.domNode);
    • summary
  • dojox.dtl.contrib.dijit.DojoTypeNode.clone

    • type
      Function
    • source: [view]
         return new this.constructor(this._node, this._parsed);
    • summary
  • dojox.dtl.contrib.dijit

    • type
      Object
    • summary
  • dojox.dtl.contrib

    • type
      Object
    • summary
  • dojox.dtl

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary