是这样,我的table是通过后台参数动态生成的,但是生成的行上绑定的函数进行遍历时获取不到表格的数据,但是我通过tr的id却可以,求解,求大神降临,求大神help谢谢谢谢!
解决方案 »
- radio 单选框 chrome 和safari 的兼容问题
- 问个js做选项卡的问题
- swfobject中转义符\ 在ie下不起作用
- 求一个正则
- 实现163邮箱的信件拖拽功能
- 请教一个关于html控件值求和问题...
- 关于一个随机广告显示的问题.
- 百分求http://www.flashempire.com/school/tutor.php 右边那QQ广告的源码,谢谢!
- JAVASCRIPT与VBSCRIPT怎么交互使用?最好能举例说明!谢谢
- 诸位高人,一个innerHTML的问题一直搞不定,请指点。
- angularjs ag-grid 怎么实现点击表头排序啊??
- json数组赋值给json对象数组
//str += id+"-"+Org_Name+"-"+Class+"-"+Parent_OrgName+",";
var layList1 = '${CcpOrgList}';
if(layList1 != "" && layList1 != null){
var topInfo = layList1.split(",");
for(var i=0;i<topInfo.length;i++){
var infos = topInfo[i].split("-");
var id = infos[0];
var Org_Name = infos[1];
var distance = infos[2]*30;
var Parent_OrgName = infos[3];
if(infos[2]< 4){
var html = "<tr id='"+id+"'><td style='font-size:15px;height:15px;width:220px;padding-top:5px;padding-left:"+distance+"px;' onclick='changeIt(\""+id+"\","+infos[2]+");'>"+Org_Name+"</td><td onmouseover='showIt(\""+id+"\");' onmouseout='hideIt(\""+id+"\");' ><input type='button' onclick='addIt(\""+id+"\","+infos[2]+");' style='width:90px;height:23px;background:#2ea2f9; border-radius:4px; font-size:13px; color:#fff; border:none; cursor:pointer;' value='+新增下级组织' /><input type='button' onclick='moveIt(\""+id+"\");' style='margin:0 10px;width:75px;height:23px;background:#2ea2f9; border-radius:4px; font-size:13px; color:#fff; border:none; cursor:pointer;' value='-删除本组织' /><input type='hidden' value='"+infos[2]+"'/></td></tr>";
}else{
var html = "<tr id='"+id+"'><td style='font-size:15px;height:15px;width:220px;padding-top:5px;padding-left:"+distance+"px;' onclick='changeIt(\""+id+"\","+infos[2]+");'>"+Org_Name+"</td><td onmouseover='showIt(\""+id+"\");' onmouseout='hideIt(\""+id+"\");' ><input type='button' onclick='moveIt(\""+id+"\");' style='width:75px;height:23px;background:#2ea2f9; border-radius:4px; font-size:13px; color:#fff; border:none; cursor:pointer;' value='-删除本组织' /><input type='hidden' value='"+infos[2]+"'/></td></tr>";
}
$("#orgTable").after(html);
}
}
}
var sid = $(this).attr("id");
var val = $("#"+sid+" td").eq(0).text();
sid = sid.substring(0,sid.lastIndexOf("_"));
if((""+fid) == (""+sid)){
flag = false;
}
});就是这个这遍历就不好使了。。(单独回复三次就不能回复了。。抱歉)
$("#orgTable tbody").append(html);
$("#orgTable").html(html);不需要累加用html