Note that there are some explanatory texts on larger screens.

plurals
  1. POI want to create links in record fields in DataTables from JSON data
    text
    copied!<p>I'm creating a dataTables table to use as an archive of pages for a site that produces a comic strip. On that archives page, I'd like to have the title of the comic be a link to the page of that comic strip.</p> <p>Initialization:</p> <pre><code> &lt;script type="text/javascript" charset="utf-8"&gt; $(document).ready(function() { $('#example').dataTable( { "bProcessing": true, "sAjaxSource": "archive/archive.txt" } ); } ); &lt;/script&gt; </code></pre> <p>HTML:</p> <pre><code>&lt;table cellpadding="0" cellspacing="0" border="0" class="display" id="example"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th width="20%"&gt;Author&lt;/th&gt; &lt;th width="25%"&gt;Title&lt;/th&gt; &lt;th width="25%"&gt;Episode&lt;/th&gt; &lt;th width="15%"&gt;Date&lt;/th&gt; &lt;th width="15%"&gt;Tags&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>JSON Data:</p> <pre><code>{ "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"] ] } </code></pre> <p>Where "Title One" or "Title Four" etc, would be a link to the page of that comic. Admittedly, I don't have much in the way of chops with dataTables, so if you might be explicit in your solution, that would be well appreciated.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload