JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="http://www.kansasoutlawwrestling.com/manager/css/style.css">
<script src="http://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.4/jquery.dataTables.js"></script>
<h2>Web Site Templates</h2>
<table id="templatesPageList" class="rounded-corner">
<thead>
<tr>
<th scope="col" class="rounded-first"></th>
<th scope="col" class="rounded">Description</th>
<th scope="col" class="rounded">Creator</th>
<th scope="col" class="rounded">Date Created</th>
<th scope="col" class="rounded">Edit</th>
<th scope="col" class="rounded-last">Delete</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="5" class="rounded-foot-left"></td>
<td class="rounded-foot-right"> </td>
</tr>
</tfoot>
<tbody>
<tr><td><input type="checkbox" name="templates" value="1"/></td><td>Main Template</td><td>Jeff Davidson</td><td>July 27, 2011</td><td><a href="#"><img src="images/user_edit.png" class="edit" alt="" title="" border="0" id="1" /></a></td><td><a href="#" class="ask"><img src="images/trash.png" class="delete" alt="" title="" border="0" id="1" /></a></td></tr><tr><td><input type="checkbox" name="templates" value="2"/></td><td>Template 2</td><td>Jeff Davidson</td><td>July 27, 2011</td><td><a href="#"><img src="images/user_edit.png" class="edit" alt="" title="" border="0" id="2" /></a></td><td><a href="#" class="ask"><img src="images/trash.png" class="delete" alt="" title="" border="0" id="2" /></a></td></tr><tr><td><input type="checkbox" name="templates" value="3"/></td><td>Testing 3</td><td>Jeff Davidson</td><td>July 27, 2011</td><td><a href="#"><img src="images/user_edit.png" class="edit" alt="" title="" border="0" id="3" /></a></td><td><a href="#" class="ask"><img src="images/trash.png" class="delete" alt="" title="" border="0"...
JavaScript
$(document).ready(function() {
var oTable = $('#templatesPageList').dataTable( {
"sDom": 'rti<"pagination"p>',
"iDisplayLength": 10,
"sPaginationType": "full_numbers",
"fnDrawCallback":function(){
if($('#templatesPageList tbody tr').length <= 10 || ($('#templatesPageList tbody td.dataTables_empty').length > 0)) {
$('div.pagination').remove();
}
if($('#templatesPageList tbody td.dataTables_empty').length == 0) {
$('.bt_red').remove();
$('.bt_blue').remove();
}
});
$('.edit').click(function(e) {
e.preventDefault();
var templateID = $(this).attr('id');
$('div.right_content').load('modules/forms/edit/templates.php?templateID=' + templateID);
});
var info = $('.dataTables_info')
$('tfoot tr td.rounded-foot-left').append(info);
$('a.bt_green').click(function(e) {
e.preventDefault();
$('div.right_content').load('modules/forms/addnew/' + $(this).attr('id'));
});
$('table tr').click(function() {
checkBox = $(this).children('td').children('input[type=checkbox]');
if(checkBox.attr('checked'))
checkBox.removeAttr('checked');
else
checkBox.attr('checked', 'checked');
});
$('.ask').jConfirmAction( {
question : "Are you sure you want to delete the selected row?",
yesAnswer : "Yes",
cancelAnswer : "No",
onYes: function(evt) {
templates(evt.target);
}
});
$('.ask2').jConfirmAction( {
question : "Are you sure you want to delete all selected rows?",
questionClass: "question2",
onYes: function(evt){
templatesArray(evt.target);
}
});
$('.viewAll').live('click', function(e) {
e.preventDefault();
oTable.fnLengthChange(-1);
...