Skip to content

Instantly share code, notes, and snippets.

@sirneb
Created September 27, 2013 19:17
Show Gist options
  • Save sirneb/6733818 to your computer and use it in GitHub Desktop.
Save sirneb/6733818 to your computer and use it in GitHub Desktop.
$('#counties').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"bAutoWidth": false,
"sPaginationType": "full_numbers",
"aoColumnDefs": [
{
"aTargets":[3],
"fnCreatedCell": function(nTd, sData, oData, iRow, iCol)
{
$(nTd).css('text-align', 'center'); // center the link
},
"mData": null,
"mRender": function( data, type, full) {
return '<a href="#" class="add"><i class="cus-plus" title="Add"></i>Add</a>';
}
}
],
"sAjaxSource": "ajaxbackend.php?function=Datatable&aColumns=CountyId,Name,(SELECT StateName FROM StateOrProvince WHERE County.StateId = StateId),''&sIndexColumn=CountyId&sTable=County"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment