<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>包含选择按钮的下拉列表(单选)</title>
<link rel="stylesheet" type="text/css" href="themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="themes/icon.css">
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.easyui.min.js"></script>
<script type="text/javascript">
$(function(){
$('#cc').combo({
required:true,
editable:false
});
//为combo设置下拉列表值
$("#sp").appendTo($("#cc").combo('panel'));
//设置选择项
$("#sp input").click(function(){
//获取选中的值
var value=$(this).val();
//获取下拉显示值
var text=$(this).next("span").text();
//设置下拉选中值
$('#cc').combo('setValue', value).combo('setText', text).combo('hidePanel');
});
});
</script>
</head>
<body>
<h3>默认情况下的Combo</h3>
<select id="cc"></select>
<div id="sp">
<div style="color:#99BBE8;background:#fafafa;padding:5px;">Select a language</div>
<input type="radio" name="lang" value="01"><span>Java</span><br/>
<input type="radio" name="lang" value="02"><span>C#</span><br/>
<input type="radio" name="lang" value="03"><span>Ruby</span><br/>
<input type="radio" name="lang" value="04"><span>Basic</span><br/>
<input type="radio" name="lang" value="05"><span>Fortran</span>
</div>
</body>
</html>