当前位置: 代码迷 >> Web前端 >> 报表默认不能修改 通过实践修改表格
  详细解决方案

报表默认不能修改 通过实践修改表格

热度:3944   发布时间:2013-02-26 00:00:00.0
表格默认不能修改 通过实践修改表格

<!--列表-->

<div id="listDiv" style="display:none;" class="iteye-blog-content-contain" >
<table cellpadding="0" cellspacing="0">
?? <tr? align="center">
????? <th>${checkAll}</th>
????? <th>name2</th>
????? <th>name3</th>
????? <th>name4</th>
????? <th>name5</th>
????? <th>name6</th>
?? </tr>

?? <tr align="center">
??????? <td><input type="checkbox" name="box" id="box" value=""></td>
?????? <td>value2</td>
?????? <td>value3</td>
?????? <td>value4</td>
?????? <td align="center"><input type="text" class="modity"? name="change22" id="change22"??????? readonly="readonly" style="border:0px;"></td>
????? <td align="center"><input type="text" class="modity" name="change3333" id="change3333" readonly="readonly" style="border:0px;" ></td>
?? </tr>
</table>

</div>
<button value="显示-隐藏列表" onclick="showAndHiden();">
<button value="参数修改状态 切换" onclick="fnModify();">
<!--事件脚本-->
<script type="text/javascript">
//该变修改或不能 修改的状态
function fnModify(){
??? if($j(".modity").attr("style") != "undefined" && $j(".modity").attr("style") != ""

??????? &&$j(".modity").attr("style")!= null){
??????????? $(".modity").removeAttr("readonly");
??????????? $(".modity").removeAttr("style");
???? }else{
?????????? $j(".modity").attr("readonly","readonly");
?????????? $j(".modity").attr("style","border:0px");
??? }
}
//显示或隐藏列表
function showAndHiden(){

????? if(document.getElementById("listDiv").style.display != "block"){
??????????? $("#listDiv").style.display = "block";
????? }else{
?????????? $("#listDiv").style.display = "none";
????? }

}
</script>

<style type="text/css">

<!--标记要修改的input-->
??? .modity{
??? }
</style>

?

  相关解决方案