关闭

dijit控件入门(三)

243人阅读 评论(0) 收藏 举报

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>checkbox_radio</title>
<link id="themeStyles" rel="stylesheet" href="../dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="../dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dijit.form.CheckBox");
dojo.require("dijit.form.RadioButton");
dojo.require("dijit.form.Form");

dojo.ready(
	function(){
		alert(document.getElementsByName("hb")[0].checked);
		}
);
</script>
</head>
<body class="claro">

<form data-dojo-type="dijit.form.Form" data-dojo-props='encType:"multipart/form-data", action:"../DojoAjax", method:"",onSubmit:function(){ return false; },'>

多选按钮
<br>
<input data-dojo-type="dijit.form.CheckBox" data-dojo-props="name:'hb',checked:true,readOnly:true"/><label for="hb">checkbox1 设置了只读,不能操作</label>
<input data-dojo-type="dijit.form.CheckBox" data-dojo-props="name:'hb'"/><label for="hb">checkbox2</label>
<input data-dojo-type="dijit.form.CheckBox" data-dojo-props="name:'hb'"/><label for="hb">checkbox3</label>

<p>
单选按钮
<br>
<input id="radio1" data-dojo-type="dijit.form.RadioButton" data-dojo-props="name:'hb_radio',value:'hb_radio1'"><label for="radio1">label1</label>
<input id="radio2" data-dojo-type="dijit.form.RadioButton" data-dojo-props="name:'hb_radio',value:'hb_radio2'"><label for="radio2">label1</label>
<input id="radio3" data-dojo-type="dijit.form.RadioButton" data-dojo-props="name:'hb_radio',value:'hb_radio3'"><label for="radio3">label1</label>
<button data-dojo-type="dijit.form.Button" data-dojo-props="onClick:function(){}">获取单选按钮的值</button>

<button id="submit2" data-dojo-type="dijit.form.Button" data-dojo-props='type:"submit"'>Submit</button>
<button id="reset2" data-dojo-type="dijit.form.Button" data-dojo-props='type:"reset"'>Reset</button>

</form>

</body>
</html>

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link id="themeStyles" rel="stylesheet" href="../dojo/dijit/themes/claro/claro.css">
<link id="themeStyles" rel="stylesheet" href="../dojo/resources/dojo.css">
<script type="text/javascript" src="../dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">

dojo.require("dijit.Editor");
dojo.require("dijit.form.Button");

function getValue(){
	//得到编辑器里面的结果
	var temp = dijit.byId("editor1").getValue();
	alert(temp);
}

function reset(){

	dijit.byId("editor1").set("value","");
}
</script>
</head>
<body class="claro">

<div data-dojo-type="dijit.Editor" id="editor1">uuuuuu</div>
<div data-dojo-type="dijit.form.Button" id="button1" data-dojo-props="onClick:getValue">得到结果</div>
<div data-dojo-type="dijit.form.Button" id="button2" data-dojo-props="onClick:reset">清除</div>


</body>
</html>

 

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link id="themeStyles" rel="stylesheet" href="../dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="../dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
    dojo.require("dijit.form.FilteringSelect");
   
</script>
</head>
<body class="claro">
<!-- 如果页面中有两个ID值是一样的,则不能同时生成FilteringSelect控件 -->
<select name="players" id="play" data-dojo-type="dijit.form.FilteringSelect" autoComplete="true" pageSize="10">  
        <option value="">Select an Arsenal Player</option>  
        <option value="Arshavin" selected="selected">Andrey Arshavin</option>  
        <option value="Vermaelen">Thomas Vermaelen</option>  
        <!– more OPTION elements here –>  
</select> 
<p>
<select name="players" id="players" dojoType="dijit.form.FilteringSelect" autoComplete="true" pageSize="10">  
        <option value="">Select an Arsenal Player</option>  
        <option value="Arshavin" selected="selected">Andrey Arshavin</option>  
        <option value="Vermaelen">Thomas Vermaelen</option>  
        <!– more OPTION elements here –>  
</select> 
</body>
</html>

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link id="themeStyles" rel="stylesheet" href="../dojo/dijit/themes/claro/claro.css">
<script type="text/javascript" src="../dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
<script type="text/javascript">

dojo.require("dijit.dijit"); // optimize: load dijit layer
dojo.require("dijit.form.Textarea");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");
dojo.require("dojo.parser");

</script>
</head>
<body class="claro">

<textarea id="blank" data-dojo-type="dijit.form.Textarea" ></textarea>

</body>
</html>

 

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:312425次
    • 积分:8738
    • 等级:
    • 排名:第2257名
    • 原创:1096篇
    • 转载:14篇
    • 译文:0篇
    • 评论:5条
    最新评论