从数据库获取的表格里的内容用SortableTable进行排序
2010-04-23 15:52
495 查看
从数据库获取的表格里的内容用SortableTable进行排序
以下是html数据内容
以下是JavaScript内容
<script language="javaScript">
var st1 = new SortableTable(document.getElementById("dataTable"),
'onMouseOnTr', [ "Number", "String", "String", "String", "String",
"String", "String"]);
</script>
注意那个thead 还有tbody的填写。
不能乱写。
以下是html数据内容
<table id="dataTable" width="95%" border="1" align="center" cellpadding="2" class="bg2"> <thead> <tr> <th nowrap="nowrap" class="center" > 序号 </th> <th nowrap="nowrap" class="center"> 代理人 </th> <th nowrap="nowrap" class="center" valign="middle"> 申请类型 </th> <th nowrap="nowrap" class="center" valign="middle"> 货物品名 </th> <th nowrap="nowrap" class="center" valign="middle"> 预计提箱日期 </th> <th nowrap="nowrap" class="center" valign="middle"> 联系人 </th> <th nowrap="nowrap" class="center" valign="middle"> 电话 </th> <th nowrap="nowrap" class="center" valign="middle"> 申请状态 </th> <th nowrap="nowrap" class="center" valign="middle"> 操作 </th> </tr> </thead> <% int i = 0; %> <logic:iterate name="lssqdListForm" property="lssqdlist" id="lssqdlist" indexId="index"> <tr style="BACKGROUND-color:#FFFFCC" mce_style="BACKGROUND-color:#FFFFCC"> <% i = i + 1; %> <td class="center" height="30px"> <%=i%> </td> <td class="center" height="30px"> <bean:write name="lssqdlist" property="dlsqc"/> </td> <td class="center" height="30px"> <param:display type="sqlxTag" name="lssqdlist" property="sqlx" /> </td> <td class="center" height="30px"> <bean:write name="lssqdlist" property="pmmc" /> </td> <td class="center" height="30px"> <bean:write name="lssqdlist" property="yjtxtimeStr" /> </td> <td class="center" height="30px"> <bean:write name="lssqdlist" property="lxr" /> </td> <td class="center" height="30px"> <bean:write name="lssqdlist" property="gddh" /> </td> <td class="center" height="30px"> <param:display type="ztflag" name="lssqdlist" property="ztflag" /> </td> <td class="center" height="30px"> <!-- ${lssqdlist.ztflag}--> <logic:equal name="lssqdlist" property="ztflag" value="0"> <a href="#" mce_href="#" onclick="forup(<bean:write name="lssqdlist" property="id" ></a>,<bean:write name="lssqdlist" property="sqlx" />)"><font color="red"> 修改</font> </a>| <a href="#" mce_href="#" onclick="remove(${lssqdlist.id},${lssqdlist.sqlx})"> <font color="red">删除</font> </a> </logic:equal> <logic:equal name="lssqdlist" property="ztflag" value="3"> <a href="#" mce_href="#" onclick="forup(<bean:write name="lssqdlist" property="id" ></a>,<bean:write name="lssqdlist" property="sqlx" />)"><font color="red"> 修改</font> </a>| <a href="#" mce_href="#" onclick="remove(${lssqdlist.id},${lssqdlist.sqlx})"><font color="red"> 删除 </font></a> </logic:equal> <logic:equal name="lssqdlist" property="ztflag" value="1"> <a href="#" mce_href="#" onclick="read(${lssqdlist.id},${lssqdlist.sqlx})"><font color="red">查 看 </font> </a> </logic:equal> <logic:equal name="lssqdlist" property="ztflag" value="2"> <a href="#" mce_href="#" onclick="read(${lssqdlist.id},${lssqdlist.sqlx})"> <font color="red">查 看 </font></a> </logic:equal> <logic:equal name="lssqdlist" property="ztflag" value="4"> <a href="#" mce_href="#" onclick="read(${lssqdlist.id},${lssqdlist.sqlx})"> <font color="red">查 看 </font></a> </logic:equal> </td> </tr> </logic:iterate> </table>
以下是JavaScript内容
<script language="javaScript">
var st1 = new SortableTable(document.getElementById("dataTable"),
'onMouseOnTr', [ "Number", "String", "String", "String", "String",
"String", "String"]);
</script>
注意那个thead 还有tbody的填写。
不能乱写。
相关文章推荐
- BootStrap table 实现表格行拖拽,并将排序结果保存到数据库
- Javascript对table表格进行排序
- web开发学习笔记(4):js获取table的行数和表格中某一行某一列的内容
- dwz框架的table,页面初始化用ajax获取并设置表格内容后,表格没有点击事件等。
- 用sorttable.js对表格进行排序
- JS实现table表格内针对某列内容进行即时搜索筛选功能
- WebDriver获取table的内容(通过动态获取Table单元格的TagName对其innerHTML值进行获取)
- bootstrap-table复选框默认选中。(从数据库获取到对应的状态进行判断是否为选中状态)
- table 上移 下移 保存时 获取每行中的值 将排序记录保存到数据库
- Sortable Table 可排序表格JS收集
- jquery对表格进行内容排序
- 通过js去对表格的列,根据其内容进行排序(升序或者降序)
- 常用的table表格排序 - sortablejs
- java代码生成Excl表格然后以附件的形式进行发送,里面的内容是用数据库的信息进行填充的。
- ajax获取返回的json内容进行排序
- 用表格显示数据库内容
- 关于Jquery获取Table中td内的内容
- jQuery实现鼠标双击Table单元格变成文本框及输入内容后更新到数据库的方法
- php正则表达式获取表格内容
- jquery获取table中的某行全部td的内容方法