async_data : function (NODE) {
return { parent_Id : $(NODE).attr("id") || 0}
}
我是这样传的,但是servlet总是拿不到parent_Id ,坐等高手解决。
经理叫我昨天把树弄好,今天还没头绪。急。
return { parent_Id : $(NODE).attr("id") || 0}
}
我是这样传的,但是servlet总是拿不到parent_Id ,坐等高手解决。
经理叫我昨天把树弄好,今天还没头绪。急。
解决方案 »
- mysql
- Spring的ApplicationContextAware问题
- 求助--正则表达式的书写
- 几道Java填空题,请高手帮忙帮忙!
- 各位大师指点下,我的servlet抛出异常javax.servlet.ServletException: Servlet execution threw an exception
- 关于weblogic的问题,高分求助!!!!
- sql2000端口号的问题,大家帮帮忙。
- 怎么把MVC中 service层的对象输出到action中?
- SQL异常处理,汗……!!!
- spring中出现乱码问题,急!
- 知道有什么办法让java持久化类生成hbm.xml文件吗
- spring定义一个bean,让别的调用
<script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script>
<script type="text/javascript" src="js/jquery.jstree.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
<style type="text/css" title="currentStyle">
@import "js/datatable/css/demo_page.css";
@import "js/datatable/css/demo_table.css";
</style>
<link href="org/js/party.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
var oTable;$(function(){
//创建AJAX表格
oTable = $('#personList').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "system/user!list.action?id="+<s:property value="id"/>,
"sPaginationType": "full_numbers",
"oLanguage":{
"sProcessing": "正在处理...",
"sLengthMenu": "每页 _MENU_ 行,
"sZeroRecords": "没有找到记录",
"sEmptyTable": "没有找到记录",
"sInfo": "当前显示从 _START_ 到 _END_ ,总记录数: _TOTAL_",
"sInfoEmpty": "",
"sSearch": "搜索:",
"oPaginate": {
"sFirst": "首页",
"sPrevious": "前页",
"sNext": "下页",
"sLast": "尾页"
}
}
} );
//点击的时候,显示被点击的记录处于选中状态
$("#personList tbody").click(function(event) {
$(oTable.fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
});
$(event.target.parentNode).addClass('row_selected');
});
});function addUser(){
var anSelected = fnGetSelected( oTable );
var personId = anSelected[0].children[0].innerHTML;
window.location = "system/user!addInput.action?id="+personId;
}function updateUser(){
var anSelected = fnGetSelected( oTable );
if(anSelected.length == 0){
alert("请选中您要更新的人员!");
return;
}
//获得被选中记录的ID
var personId = anSelected[0].children[0].innerHTML;
window.location = "system/user!updateInput.action?id="+personId;
}function deleteUser(){ var anSelected = fnGetSelected( oTable );
if(anSelected.length == 0){
alert("请选中您要删除的人员账号!");
return;
}
if(!confirm("请确认是否要删除选中的人员账号,删除操作不可恢复,请小心操作!")){
return;
}
//获得被选中记录的ID
var personId = anSelected[0].children[0].innerHTML;
$.get("system/user!del.action?id="+personId,function(){
oTable.fnDeleteRow( anSelected[0] );
});
}
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i<aTrs.length ; i++ )
{
if ( $(aTrs[i]).hasClass('row_selected') )
{
aReturn.push( aTrs[i] );
}
}
return aReturn;
}
</script>
</head>
<body><div>
<table id="personList" class="display" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
<thead>
<tr>
<th width="10" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">ID</span></div></th>
<th width="60" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">姓名</span></div></th>
<th width="25" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">所在部门</span></div></th>
<th width="50" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">登录账号</span></div></th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="4">这里是数据</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
获取选中节点的子节点 ifchild = dtnode.data.children;