我正在创建一个 dataTables 表,用作生成漫画的网站的页面存档。在该档案页面上,我想让漫画的标题成为该漫画页面的链接。
初始化:
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"sAjaxSource": "archive/archive.txt"
} );
} );
</script>
HTML:
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
<thead>
<tr>
<th width="20%">Author</th>
<th width="25%">Title</th>
<th width="25%">Episode</th>
<th width="15%">Date</th>
<th width="15%">Tags</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
JSON数据:
{ "aaData": [
["Bob","Title One","Episode 1","9/30/2010","tag1,tag2,tag3"],
["Bob","Title One","Episode 2","10/2/2010","tag1,tag2,tag3"],
["Bob","Title One","Episode 3","10/4/2010","tag1,tag2,tag3"],
["Bob","Title Four","Episode 1","10/8/2010","tag1,tag2,tag3"],
["Bob","Title Five","Episode 1","10/11/2010","tag1,tag2,tag3"],
["Bob","Title Six","Episode 1","10/12/2010","tag1,tag2,tag3"],
["Kevin","Title Seven","Episode 1","10/15/2010","tag1,tag2,tag3"],
["Kevin","Title Eight","Episode 1","10/17/2010","tag1,tag2,tag3"],
["Kevin","Title Eight","Episode 2","10/20/2010","tag1,tag2,tag3"],
["Kevin","Title Ten","Episode 1","10/22/2010","tag1,tag2,tag3"],
["Kevin","Title Eleven","Episode 1","10/23/2010","tag1,tag2,tag3"],
["Kevin","Title Twelve","Episode 1","10/24/2010","tag1,tag2,tag3"]
] }
其中“标题一”或“标题四”等将是该漫画页面的链接。诚然,我对 dataTables 的处理方式并不多,因此,如果您可能在解决方案中明确表示,那将不胜感激。