UNPKG

dojox

Version:

Dojo eXtensions, a rollup of many useful sub-projects and varying states of maturity – from very stable and robust, to alpha and experimental. See individual projects contain README files for details.

103 lines (89 loc) 4.12 kB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/> <meta name="apple-mobile-web-app-capable" content="yes" /> <title>Icon</title> <link href="../../../themes/iphone/base.css" rel="stylesheet"/> <link href="../../../themes/iphone/IconContainer.css" rel="stylesheet"/> <style> .box { border: 1px solid #A7C0E0; width: 300px; height: 250px; background-image: url(../../images/widget-bg.png); background-repeat: no-repeat; background-color: white; } </style> <script type="text/javascript" src="../../../../../dojo/dojo.js" data-dojo-config="parseOnLoad: true"></script> <script language="JavaScript" type="text/javascript"> //dojo.require("dojo.parser"); // Use the lightweight parser. dojo.require("dojox.mobile.parser"); dojo.require("dojox.mobile"); dojo.require("dojox.mobile.View"); dojo.require("dojox.mobile.IconContainer"); dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat"); dojo.addOnLoad(function(){ var view = dijit.byId("view1"); var container = new dojox.mobile.IconContainer(); var demoWidget = new dojox.mobile.IconItem({label:"app1", icon:"../../images/icon3.png", lazy:"true"}); //This position works fine. // view.addChild(container); container.placeAt(view.containerNode); container.startup(); container.addChild(demoWidget); demoWidget.set("content", '<div class="box"></div>'); demoWidget = new dojox.mobile.IconItem({label:"app2", icon:"../../images/icon3.png", lazy:"true"}); container.addChild(demoWidget); demoWidget.set("content", '<div class="box"></div>'); demoWidget = new dojox.mobile.IconItem({label:"app3", icon:"../../images/icon3.png", lazy:"true"}); demoWidget.set("content", '<div class="box"></div>'); //This position makes error. //Fixed container.addChild(demoWidget); demoWidget = new dojox.mobile.IconItem({label:"moveTo", icon:"../../images/icon3.png", moveTo:"about", transition:"slide"}); container.addChild(demoWidget); demoWidget = new dojox.mobile.IconItem({label:"href", icon:"../../images/icon3.png", href:"../../test_iPhone-RoundRectList.html", transition:"slide"}); container.addChild(demoWidget); demoWidget = new dojox.mobile.IconItem({label:"url", icon:"../../images/icon3.png", url:"../../data/view-sample.html", transition:"slide"}); container.addChild(demoWidget); demoWidget = new dojox.mobile.IconItem({id: "url2", label:"url 2", icon:"../../images/icon3.png", url:"../../data/view-sample.html", transition:"slide"}); demoWidget.callback = function(){ window.testCallback1Ok = true; } container.addChild(demoWidget); demoWidget = new dojox.mobile.IconItem({id: "url3", label:"url 3", icon:"../../images/icon3.png", url:"../../data/view-sample.html", transition:"slide", callback: "method1"}); demoWidget.method1 = function(){ window.testCallback2Ok = true; } container.addChild(demoWidget); //This position makes error. // view.addChild(container); // container.placeAt(view.containerNode); // container.startup(); }); </script> <script type="text/javascript" src="../TestUtil.js"></script> <script type="text/javascript" src=IconContainer.js></script> </head> <body> <div id="view1" dojoType="dojox.mobile.View" selected="true"> <h1 dojoType="dojox.mobile.Heading">Icon Container</h1> </div> <div id="about" dojoType="dojox.mobile.View"> <h1 dojoType="dojox.mobile.Heading" back="Icon Container" moveTo="view1">About</h1> <h2 dojoType="dojox.mobile.RoundRectCategory">My Phone</h2> <ul dojoType="dojox.mobile.RoundRectList"> <li dojoType="dojox.mobile.ListItem" rightText="AcmePhone"> Network </li> <li dojoType="dojox.mobile.ListItem" rightText="AcmePhone"> Line </li> <li dojoType="dojox.mobile.ListItem" rightText="1024"> Songs </li> </ul> </div> </body> </html>