在下面的代码中怎么定义ComboTree(id是cc),的onSelect事件,我这里用
$('#cc').combotree({onSelect:function(node) {
alert("dd");
}
})
为什么不起作用?请问大侠们应该怎么做,请大家帮帮忙,以下是详细的代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery EasyUI</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.4.4.min.js"></script>
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery.combotree.js"></script>
<script>
function reload(){
$('#cc').combotree('reload');
}
function setValue(){
$('#cc').combotree('setValue', 2);
}
function getValue(){
var val = $('#cc').combotree('getValue');
alert(val);
}
function disable(){
$('#cc').combotree('disable');
}
function enable(){
$('#cc').combotree('enable');
} $('#cc').combotree({
onSelect:function(node) {
alert("dd");
}
})
</script>
</head>
<body>
<h1>ComboTree</h1>
<div style="margin-bottom:10px;">
<a href="#" onclick="reload()">reload</a>
<a href="#" onclick="setValue()">setValue</a>
<a href="#" onclick="getValue()">getValue</a>
<a href="#" onclick="disable()">disable</a>
<a href="#" onclick="enable()">enable</a>
</div>
<span>Select:</span>
<input id="cc" class="easyui-combotree" url="tree_data.json" value="2" required="true" style="width:200px;" >
<select id="ccClassTree" class="easyui-combotree" name="language" url="tree_data.json" multiple="true" cascadeCheck="false" style="width:200px;"></select>
</body>
</html>
$('#cc').combotree({onSelect:function(node) {
alert("dd");
}
})
为什么不起作用?请问大侠们应该怎么做,请大家帮帮忙,以下是详细的代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery EasyUI</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.4.4.min.js"></script>
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery.combotree.js"></script>
<script>
function reload(){
$('#cc').combotree('reload');
}
function setValue(){
$('#cc').combotree('setValue', 2);
}
function getValue(){
var val = $('#cc').combotree('getValue');
alert(val);
}
function disable(){
$('#cc').combotree('disable');
}
function enable(){
$('#cc').combotree('enable');
} $('#cc').combotree({
onSelect:function(node) {
alert("dd");
}
})
</script>
</head>
<body>
<h1>ComboTree</h1>
<div style="margin-bottom:10px;">
<a href="#" onclick="reload()">reload</a>
<a href="#" onclick="setValue()">setValue</a>
<a href="#" onclick="getValue()">getValue</a>
<a href="#" onclick="disable()">disable</a>
<a href="#" onclick="enable()">enable</a>
</div>
<span>Select:</span>
<input id="cc" class="easyui-combotree" url="tree_data.json" value="2" required="true" style="width:200px;" >
<select id="ccClassTree" class="easyui-combotree" name="language" url="tree_data.json" multiple="true" cascadeCheck="false" style="width:200px;"></select>
</body>
</html>
解决方案 »
- 如何判断模式窗口关闭了
- js的实现一种效果
- 如果<td>的宽度是百分比,哪么<input type=text>的宽度等于当前<td>的度度怎么做啊?
- google url编码的 解码问题 88分求援...
- 如何修改这段验证手机号的代码:Mobile : /^((\(\d{2,3}\))|(\d{3}\-))?13\d{9}$/,
- 如何将 TD 元素里面的 背景 缩放到 TD 一样大小 ????????? 急!!!!!!!!!!!!!!!!!!!!!
- 在js中如何实现对<tr>的直接克隆?
- javascript怎样动态添加dropdown里的值,急,大哥,帮帮忙
- [求助]怎么求得表格Rows
- 移动端怎么判断手指移入移出元素?
- 为什么在js写的cookie只保存在当前页面
- 我想要个每隔15秒的 js图片抖动 指点指点。。。
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<script type="text/javascript" src="../jquery.combotree.js"></script>位置对么 ~~~~~~
LZ不妨看下源码里那个onSelect事件怎么用的
$('#cc').combotree({onSelect:function(node) {
alert("dd");
}
})
这是从网上看到的,但是不起作用
改成这样试试
$(document).ready(function () {
$('#cc').combotree({
onSelect: function (node) {
alert("dd");
}
})
});