Advertisement
Guest User

Untitled

a guest
Mar 9th, 2011
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.45 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.     <title> new document </title>
  5.     <meta name="generator" content="editplus" />
  6.     <meta name="author" content="" />
  7.     <meta name="keywords" content="" />
  8.     <meta name="description" content="" />
  9.     <script djConfig=" isDebug: true, useCommentedJson: true,parseOnLoad: true" src="http://127.0.0.1/Eclipse_projects/quickstart/public/JS/dojo150r/dojo/dojo.js"></script>
  10.         <style type="text/css">
  11.         @import "http://127.0.0.1/Eclipse_projects/quickstart/public/JS/dojo150r/dojo/resources/dojo.css";
  12.         @import "http://127.0.0.1/Eclipse_projects/quickstart/public/JS/dojo150r/dijit/themes/soria/soria.css";
  13.     </style>
  14.  
  15.     <style type="text/css">
  16.  
  17.     </style>
  18.     <link id="themeStyles" rel="stylesheet" href="">
  19.  
  20.   <script type="text/javascript">
  21.         dojo.require("dijit._Widget");
  22.         dojo.require("dijit._Templated");
  23.  
  24.         dojo.ready(function(){
  25.             dojo.byId('log').value='';
  26.             dojo.declare("MyWidget", [dijit._Widget, dijit._Templated], {
  27.                 templateString: '<div id="MyWidget_${id}" dojoAttachPoint="x"><input id="${id}" name="bar"/></div>',
  28.                 constructor:function(params, srcNodeRef){
  29.                 },
  30.                 buildRendering: function(){
  31.                     this.inherited("buildRendering",arguments);
  32.                     log('buildRendering this.x.id : '+ this.x.id);
  33.                     dumpParent( this.x);
  34.                     //this.id=this.domNode.id;
  35.                 },
  36.                 postCreate: function(){
  37.                     this.inherited("postCreate",arguments);
  38.                     log('postCreate this.x.id : '+ this.x.id);
  39.                     dumpParent( this.x);
  40.                 },
  41.                 startup: function(){
  42.  
  43.                     this.inherited("startup",arguments);
  44.                     log('startup this.x.id : '+ this.x.id);
  45.                     dumpParent( this.x);
  46.                 }
  47.             });
  48.  
  49.             var y;
  50.             var x=new MyWidget({},dojo.byId('j'));
  51.             x.startup();
  52.             log("logged: "+dijit.registry.byClass("MyWidget"));
  53.             console.log(dijit.registry.byClass("MyWidget"));
  54.         });
  55.  
  56.         function log(msg){
  57.             dojo.byId('log').value+=(msg+"\n");
  58.         }
  59.         function dumpParent(element)
  60.         {
  61.             if(element.parentNode)
  62.                 dojo.byId('log').value+=(
  63.                     "-----------------\n\t"+
  64.                     element.parentNode.innerHTML+
  65.                     "\n-----------------\n");
  66.             else
  67.                 dojo.byId('log').value+=("parentNode is NULL\n");
  68.         }
  69.  
  70.   </script>
  71.  </head>
  72.  
  73.  <body class="soria">
  74.     <div id="sd"><input type="text" name="j" id="j" /></div>
  75.     <textarea id='log' style="width:600px;height:200px;"></textarea>
  76.  </body>
  77. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement