DoJo中如何使用dojox工具? [英] How to use dojox tools in DoJo?

查看:103
本文介绍了DoJo中如何使用dojox工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习Dojo。所以我想通过如何在Dojo中使用量规来构建我的第一个演示。
我下载了zip包,并构建了一个asp.net的web项目。那么Dojo包中的所有资源都将导入到该项目中。



因为我看到了DoJo网站的演示: http://demos.dojotoolkit.org/demos/gauges/demo.html ,所以我想在本地计算机上复制这个演示文稿现有的DoJo资源。
以下HTML代码:

 <%@ Page Language =C#AutoEventWireup =trueCodeBehind = Default.aspx.csInherits =DojoDaemon.Default%> 

< DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional。 DTD>

< html xmlns =http://www.w3.org/1999/xhtml>
< head runat =server>
< title> Dojo Circular Gauge Test Daemon< / title>
< link href =样式/ Site.css =stylesheettype =text / css/>
< script src =Scripts / dojo-release-1.9.1 / dojo / dojo.jstype =text / javascriptdata-dojo-config =async:true>< / script> ;
< script src =Scripts / dojo-release-1.9.1 / dojox / dgauges / components / black / CircularLinearGauge.js
type =text / javascriptdata-dojo-config =异步:真>< /脚本>
< script src =Scripts / dojo-release-1.9.1 / dojox / dgauges / components / black / Horizo​​ntalLinearGauge.js
type =text / javascriptdata-dojo-config =异步:真>< /脚本>
< script src =Scripts / dojo-release-1.9.1 / dojox / dgauges / components / black / SemiCircularLinearGauge.js
type =text / javascriptdata-dojo-config =异步:真>< /脚本>
< / head>
< body>
< form runat =serverid =form1>
< h2 align =centerstyle =color:white;>预定义光泽量规< / h2>
< table style =height:100%; width:100%>
< tr>
< td align =center>
< div id =CircularGaugebackground ={color:'rgba(0,0,0,0)'}useTooltip =falsedata-dojo-type =Scripts / dojo-release- 1.9.1 / dojox / dgauges / components / black / CircularLinearGaugestyle =width:200px; height:200pxvalue =20>< / div>< / td>
< td align ='center'>
< div id =CircularGauge2background ={color:'rgba(0,0,0,0)'}useTooltip =falsedata-dojo-type =Scripts / dojo-release- 1.9.1 / dojox / dgauges / components / black / SemiCircularLinearGaugevalue =10style =width:250px; height:200px>< / div>< / td>
< / tr>
< tr>
< td valign =middlealign =centercolspan =2>
< div id =HGauge3style =margin:30px 0px 0px 0px; width:400px; height:60pxuseTooltip =falsebackground ={color:'rgba(0,0,0, 0)'}data-dojo-type =Scripts / dojo-release-1.9.1 / dojox / dgauges / components / black / Horizo​​ntalLinearGaugevalue =20>< / div>< / td>
< / tr>
< / table>
< / form>
< / body>
< / html>

以上是我使用的代码,我搜索了很多例子,但没有什么,因为没有人文章给我详细的步骤教我如何使用dojox文件夹中的资源。
资源我发现像:
http://dojotoolkit.org/api/ dojox / dgauges / CircularGauge
http:// dmandrioli。 github.io/dgauges/dojox/dgauges/CircularGauge.html
有人会帮助我吗?非常感谢你。

解决方案

你只需要在src中加载​​dojo.js,并且 src.js ,它们包含在演示中。点击查看源的 http://demos.dojotoolkit.org/demos/gauges/demo .html ,并复制代码!



Dojo首先看起来像一个野兽,但它是一个美丽的工具包,你会来爱上和欣赏。给它时间。我强烈建议您在跳到dguage和其他高级内容之前说您好Dojo


I am now learning Dojo. So I want to build my first demo by how to use gauges in Dojo. I downloaded the zip package and build an asp.net web project. then all the resources from Dojo package are imported to this project.

Because I saw the demo from DoJo website: http://demos.dojotoolkit.org/demos/gauges/demo.html, So I want to copy this demo in my local computer with existing DoJo resources. HTML code below:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="DojoDaemon.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Dojo Circular Gauge Test  Daemon</title>
<link href="Styles/Site.css" rel="stylesheet" type="text/css" />
<script src="Scripts/dojo-release-1.9.1/dojo/dojo.js" type="text/javascript"  data-dojo-config="async:true"></script>
<script src="Scripts/dojo-release-1.9.1/dojox/dgauges/components/black/CircularLinearGauge.js"
    type="text/javascript" data-dojo-config="async:true"></script>
<script src="Scripts/dojo-release-1.9.1/dojox/dgauges/components/black/HorizontalLinearGauge.js"
    type="text/javascript" data-dojo-config="async:true"></script>
<script src="Scripts/dojo-release-1.9.1/dojox/dgauges/components/black/SemiCircularLinearGauge.js"
    type="text/javascript" data-dojo-config="async:true"></script>
</head>
<body>
<form runat="server" id="form1">
<h2 align="center" style="color:white;">Predefined Glossy Gauges</h2>
<table style="height:100%; width:100%">
         <tr>
    <td align="center">
    <div id="CircularGauge" background="{color:'rgba(0,0,0,0)'}" useTooltip="false" data-dojo-type="Scripts/dojo-release-1.9.1/dojox/dgauges/components/black/CircularLinearGauge" style="width:200px;height:200px" value="20"></div></td>
    <td align='center'>
    <div id="CircularGauge2" background="{color:'rgba(0,0,0,0)'}" useTooltip="false"  data-dojo-type="Scripts/dojo-release-1.9.1/dojox/dgauges/components/black/SemiCircularLinearGauge" value="10" style="width:250px;height:200px"></div></td>
     </tr>
     <tr> 
     <td valign="middle" align="center" colspan="2">
    <div id="HGauge3" style="margin:30px 0px 0px 0px;width:400px;height:60px" useTooltip="false" background="{color:'rgba(0,0,0,0)'}"  data-dojo-type="Scripts/dojo-release-1.9.1/dojox/dgauges/components/black/HorizontalLinearGauge" value="20"></div></td>
    </tr>
</table>
</form>
</body>
 </html>

Above is the code I use, I have searched a lot of examples, but got nothing because no one article give me the detailed steps to teach me how to use the resources in dojox folder. resources I found like : http://dojotoolkit.org/api/dojox/dgauges/CircularGauge http://dmandrioli.github.io/dgauges/dojox/dgauges/CircularGauge.html Would anyone help me if familar with this? thank you ver much.

解决方案

You only need to load dojo.js in the src and the src.js which they have included for the demo. Click on the View Source of http://demos.dojotoolkit.org/demos/gauges/demo.html and copy the code exactly!

Dojo can seem like a beast at first, but its a beautiful toolkit that you will come to love and appreciate. Give it time. I STRONGLY recommend you say Hi to Dojo before jumping to dguage and other advanced stuff.

这篇关于DoJo中如何使用dojox工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆