Tuesday, May 18, 2010

Dojo How to ColorPalette + TooltipDialog + DropDownButton

function changeColor(selectColor) {
console.log("color: " + selectColor);
}

dojo.addOnLoad( function() {
var censusContainer = new dijit.layout.BorderContainer({
style: "width: 30%; height: 30%",
gutters: false,
design: "headline"
},"censusContainerId");


var paramsContent = new dijit.layout.ContentPane();
var colorPalette = new dijit.ColorPalette({onChange:changeColor});
var colorPalette2 = new dijit.ColorPalette({onChange:changeColor});
censusContainer.addChild(colorPalette);
var dropDownButton = new dijit.form.DropDownButton({label: "drop", dropDown: colorPalette2});
censusContainer.addChild(dropDownButton);
censusContainer.startup();
}

HTML:

<body class="tundra">
<div id="censusContainerId" region="top" >Region top</div>
<div dojoType="dijit.ColorPalette" onChange="changeColor"></div>
</body>

No comments:

Post a Comment