日期:2014-05-17  浏览次数:20469 次

dwz 主从表结构 序号问题
<table name="table1" class="list nowrap itemDetail" addButton="新增记录" width="100%">
<thead>
<tr>
  <th type="hidden" name="items[#index#].itemInt" defaultVal="#index#" size="12" fieldClass="digits">序号</th>

  <th type="text" name="items[#index#].itemprice" size="12" fieldClass="number required">单价(元)</th>
  <th type="text" name="items[#index#].itemnum" size="12" fieldClass="number required">数量</th>
  <th type="hidden" name="items[#index#].itemtotalprice" size="12" >总价(元)</th>
<th type="del" width="60">删除</th>
</tr>
</thead>
<tbody>
   
  </tbody>
</table>
点删除后 如何 删除时重新初始化 序号的 下标

------解决方案--------------------
楼主说的序列号是说绑定出来的序列号吧,数据库中是无法重新初始化的!楼主用的table绑定数据吗?
你可以用Gridview绑定! 序列号列: <%#Container.DataItemIndex+1 %>
------解决方案--------------------
你这是一个HTML模版 在后台读取在显示到浏览器里吧。
给你说个思路 你可以给删除按钮绑定一个click事件 用javascript或者jquery 获取表单里的name属性 让其清空 
让后再赋值到原来的状态
JScript code

     var name = document.getElementById("要清空的控件ID");
     name.getAttribute("name","初始值");