1
{{if session.s3.debug:}}
2
<script src="/{{=request.application}}/static/scripts/S3/jquery.dataTables.fixed.js" type="text/javascript" charset="utf-8"></script>
4
<script src="/{{=request.application}}/static/scripts/S3/jquery.dataTables.fixed.min.js" type="text/javascript" charset="utf-8"></script>
6
<script type="text/javascript">//<![CDATA[
7
$(document).ready(function() {
8
//Create an array for the column settings (this is required, otherwise the column widths don't autosize)a
9
var myList = document.getElementById('list');
11
var ColumnCount = myList.getElementsByTagName('th').length;
15
var ColumnSettings = new Array();
16
ColumnSettings[0] = { "sTitle": " ", "bSortable": false }
17
// buffer the array so that the default settings are preserved for the rest of the columns
18
for (i=1; i<ColumnCount; i++)
20
ColumnSettings[i] = null;
22
$('#list').dataTable({
25
{"aaSorting": {{=XML(sortby)}}},
30
{{if response.s3.pagination:}}
31
// Disable Dynamic Search (until support for this fixed)
33
// Disable Dynamic Sorting (until support for this fixed - works by value not representation)
35
"sPaginationType": "full_numbers",
39
"sAjaxSource": "{{=jr.there(representation='aaData')}}",
41
{{if response.s3.actions:}}
42
"aoColumns": ColumnSettings,
43
// Set the action buttons in the id (first) column for each row
44
"fnRowCallback": function( nRow, aData, iDisplayIndex )
46
Actions = {{=XML(response.s3.actions)}};
48
// loop through each action to build the button
49
for (i=0;i<Actions.length;i++)
51
// Extract the id # from the link
53
id = re.exec(aData[0])[1];
56
Buttons = Buttons + '<a class="'+ c +'" href="' + Actions[i].url.replace(re,id) + '">' + Actions[i].label + '</a>' + ' ';
58
// Set the first column to the action buttons
59
$('td:eq(0)', nRow).html( Buttons );