Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: JavaScript | Size: 1.90 KB | Hits: 64 | Expires: Never
Copy text to clipboard
  1. <html>
  2. <head>
  3.   <title>jstrader</title>
  4.   <style type="text/css" title="text/css">
  5.     @import "http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/resources/dojo.css";
  6.     @import "http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css";
  7.     .tundra {
  8.       font-family: verdana, tahoma, sans-serif;
  9.       font-size: 0.7em;
  10.     }
  11.     body {
  12.       width: 100%;
  13.       height: 100%;
  14.     }
  15.     .dndDropIndicator {
  16.       border: 2px dashed #99BBE8;
  17.       cursor:default;
  18.     }
  19.     .gridContainerZone {
  20.       vertical-align: top;
  21.     }
  22.  
  23.     #gc1 { background: #eee; }
  24.   </style>
  25. <script TYPE="text/javascript"  SRC="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js" djConfig="parseOnLoad: true"></script>
  26. <script type="text/javascript">
  27.   dojo.require("dojo.parser");
  28.   dojo.require('dijit.form.Button');
  29.   dojo.require("dijit.TitlePane");
  30.   dojo.require("dijit.layout.ContentPane");
  31.   dojo.require("dojox.widget.Portlet");
  32.   dojo.require("dojox.layout.GridContainer");
  33.  
  34.  
  35.   dojo.addOnLoad(function(){
  36.     gc1 = new dojox.layout.GridContainer({
  37.     nbZones: 3,
  38.     opacity: 0.7,
  39.     allowAutoScroll: true,
  40.     hasResizableColumns: true,
  41.     withHandles: true,
  42.     acceptTypes: "dijit.layout.ContentPane,dijit.TitlePane"}, dojo.byId('gc1'));
  43.     gc1.startup();
  44.     //gc1.resize();
  45.   });
  46.  
  47.   function addRandom() {
  48.     var n = new dijit.TitlePane ({title: 'Newpane'}, dojo.doc.createElement('div'));
  49.     var txt = '';
  50.     var c = Math.floor (Math.random()*100);
  51.     for (var i=0; i < c; i++) {
  52.       txt += Math.floor (Math.random()*100) + ' ';
  53.     }
  54.     n.setContent (txt);
  55.     n.attr('dndType', 'TitlePane');
  56.     gc1.addChild (n);
  57.     n.startup();
  58.     //gc1.startup();
  59.   }
  60. </script>
  61. </head>
  62. <body class="tundra">
  63.   <h1>Hello world</h1>
  64.  
  65.   <button dojoType="dijit.form.Button" onClick="addRandom()">New</button>
  66.  
  67.   <div id="gc1">
  68.   </div>
  69.  
  70. </body>