[英]Using JQuery table sorter in Struts2
My problem is mainly getting the tablesorter from jquery to operate correctly. 我的问题主要是从jquery使tablesorter正常运行。 I believe the issue stems from the fact that I use an iterator to display my table information - which is necessary in the way I have designed my struts2 pages.
我认为问题源于我使用迭代器显示表信息的事实-这是我设计struts2页面的方式所必需的。
To start I have placed the jquery-1.11.1.min.js file within my WEB-INF/lib folder. 首先,我将jquery-1.11.1.min.js文件放在我的WEB-INF / lib文件夹中。 I felt like this was a convenient place to put it.
我觉得这是个方便放置的地方。 Therefore my tags in my jsp page look like:
因此,我在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>
then within my body I have my table which looks like: 然后我体内的桌子如下:
<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>
My question is, what am I missing? 我的问题是,我想念什么? Is the iterator why I can't get the table sorter to work?
迭代器是为什么我无法使表排序器正常工作吗? Is it my formatting?
是我的格式吗?
Any help information or better yet examples would be greatly appreciated. 任何帮助信息或更好的例子将不胜感激。
follow this jsFiddle. 遵循此jsFiddle。 hjsfiddle.net/Mottie/4mVfu/1/
hjsfiddle.net/Mottie/4mVfu/1/
You will find what you are missing. 您会发现自己所缺少的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.