easyui的treegrid怎么样实现勾选的时候获取对应的行数据,触发事件加在哪里,怎么添加?
$('#tt').treegrid({url:url1,//访问后台的地址idField:'id',treeField:'name',animate:true,fitCo...
$('#tt').treegrid({url:url1, //访问后台的地址idField:'id',treeField:'name',animate:true,fitColumns:true,state:'closed',columns:[[{field:'CK',title:'',checkbox: true, width:30},{field:'id',title:'部门编号',width:60,align:'center'}]]});
展开
1个回答
展开全部
<head>
<meta name="generator" content="HTML Tidy, see ">
<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">
$(function(){
$('#tt2').tree({
checkbox: true,
url: 'tree_data.json',
onClick: function(node){
$(this).tree('toggle', node.target);
//alert('you dbclick '+node.text);
},
onContextMenu: function(e, node){
e.preventDefault();
$('#tt2').tree('select', node.target);
$('#mm').menu('show', {
left: e.pageX,
top: e.pageY
});
}
});
<meta name="generator" content="HTML Tidy, see ">
<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">
$(function(){
$('#tt2').tree({
checkbox: true,
url: 'tree_data.json',
onClick: function(node){
$(this).tree('toggle', node.target);
//alert('you dbclick '+node.text);
},
onContextMenu: function(e, node){
e.preventDefault();
$('#tt2').tree('select', node.target);
$('#mm').menu('show', {
left: e.pageX,
top: e.pageY
});
}
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询