Untitled
By: a guest | Feb 9th, 2010 | Syntax:
JavaScript | Size: 1.90 KB | Hits: 64 | Expires: Never
<html>
<head>
<title>jstrader</title>
<style type="text/css" title="text/css">
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/resources/dojo.css";
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.4/dijit/themes/tundra/tundra.css";
.tundra {
font-family: verdana, tahoma, sans-serif;
font-size: 0.7em;
}
body {
width: 100%;
height: 100%;
}
.dndDropIndicator {
border: 2px dashed #99BBE8;
cursor:default;
}
.gridContainerZone {
vertical-align: top;
}
#gc1 { background: #eee; }
</style>
<script TYPE="text/javascript" SRC="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dojo.parser");
dojo.require('dijit.form.Button');
dojo.require("dijit.TitlePane");
dojo.require("dijit.layout.ContentPane");
dojo.require("dojox.widget.Portlet");
dojo.require("dojox.layout.GridContainer");
dojo.addOnLoad(function(){
gc1 = new dojox.layout.GridContainer({
nbZones: 3,
opacity: 0.7,
allowAutoScroll: true,
hasResizableColumns: true,
withHandles: true,
acceptTypes: "dijit.layout.ContentPane,dijit.TitlePane"}, dojo.byId('gc1'));
gc1.startup();
//gc1.resize();
});
function addRandom() {
var n = new dijit.TitlePane ({title: 'Newpane'}, dojo.doc.createElement('div'));
var txt = '';
var c = Math.floor (Math.random()*100);
for (var i=0; i < c; i++) {
txt += Math.floor (Math.random()*100) + ' ';
}
n.setContent (txt);
n.attr('dndType', 'TitlePane');
gc1.addChild (n);
n.startup();
//gc1.startup();
}
</script>
</head>
<body class="tundra">
<h1>Hello world</h1>
<button dojoType="dijit.form.Button" onClick="addRandom()">New</button>
<div id="gc1">
</div>
</body>