[英]Using JQuery table sorter in Struts2
我的问题主要是从jquery使tablesorter正常运行。 我认为问题源于我使用迭代器显示表信息的事实-这是我设计struts2页面的方式所必需的。
首先,我将jquery-1.11.1.min.js文件放在我的WEB-INF / lib文件夹中。 我觉得这是个方便放置的地方。 因此,我在jsp页面中的标签如下所示:
<head>
<script type="text/javascript" src="/My_Project/WebContent/WEB-INF/lib/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/My_Project/WebContent/WEB-INF/lib/jquery-1.11.1.min.tablesorter.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#table").tablesorter();
});
</script>
</head>
然后我体内的桌子如下:
<table id="table" class="tablesorter">
<thead>
<tr>
<th>column</th>
<th>column</th>
</tr>
</thead>
<tbody>
<s:iterator status="stat" value="listTable">
<TR>
<TD><s:property value="%{row1}" /></td>
<TD><s:property value="%{row2}" /></td>
</TR>
</s:iterator>
</tbody>
</table>
我的问题是,我想念什么? 迭代器是为什么我无法使表排序器正常工作吗? 是我的格式吗?
任何帮助信息或更好的例子将不胜感激。
遵循此jsFiddle。 hjsfiddle.net/Mottie/4mVfu/1/
您会发现自己所缺少的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.