我正在尝试使用 TinyTableV3 JQuery 插件;但是,我不断收到“未定义”不存在错误。然后,当单击列进行排序时,我得到“排序器”不存在错误。这表明存在初始化问题,但由于该插件似乎没有自述文件,我不确定它可能出错的地方。代码如下。帮助?
<html>
<head>
<script type="text/javascript" src="javascript/jquery.1.8.3.min.js"></script>
<script type="text/javascript" src="javascript/TinyTableV3/script.js"></script>
<script type="text/javascript">
var sorter;
$(document).ready(function () {
sorter = new TINY.table.sorter('sorter', 'listtbl', {
headclass: 'head',
ascclass: 'asc',
descclass: 'desc',
evenclass: 'evenrow',
oddclass: 'oddrow',
evenselclass: 'evenselected',
oddselclass: 'oddselected',
paginate: false,
size: 100,
sortcolumn: 1,
sortdir: 1,
init: true
});
});
</script>
</head>
<body>
<table id="listtbl" class="listtbl">
<tr>
<th>number</th>
<th>name</th>
<th>address</th>
<th>comment</th>
</tr>
<tr>
<td>97</td>
<td>bob</td>
<td>666 mantime</td>
<td>this is a comment</td>
</tr>
<tr>
<td>912</td>
<td>daisy</td>
<td>856 mantime</td>
<td>this is a comment</td>
</tr>
<tr>
<td>24</td>
<td>john</td>
<td>666 sooome</td>
<td>this is a comment</td>
</tr>
<tr>
<td>365</td>
<td>kindle</td>
<td>66 mantimed</td>
<td>this is a comment</td>
</tr>
<tr>
<td>56</td>
<td>ishmael</td>
<td>12 diddles</td>
<td>this is a comment</td>
</tr>
<tr>
<td>234</td>
<td>hoppy</td>
<td>666 mantime</td>
<td>this is a comment</td>
</tr>
<tr>
<td>43</td>
<td>snaps</td>
<td>666 mantime</td>
<td>this is a comment</td>
</tr>
<tr>
<td>123</td>
<td>pickpic</td>
<td>666 mantime</td>
<td>this is a comment</td>
</tr>
<tr>
<td>15</td>
<td>hahazabamadan</td>
<td>666 mantime</td>
<td>this is a comment</td>
</tr>
</table>
</body>
</html>
在http://www.scriptiny.com/2009/11/advanced-javascript-table-sorter/找到的小表 v3