Skip to content

Instantly share code, notes, and snippets.

@willianantunes
Last active August 29, 2015 14:06
Show Gist options
  • Save willianantunes/5e2ecc31fb716b0a8ef0 to your computer and use it in GitHub Desktop.
Save willianantunes/5e2ecc31fb716b0a8ef0 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
$.LABDT = new Object();
$.LABDT.url = "<c:url value="/"/>";
$.LABDT.dataTables_LanguageFile = $.LABDT.url + "js/dataTables/languages/" + "dataTables." + "<fmt:message key="config.language"/>" + ".txt";
$.LABDT.dataTables_SearchName = "<fmt:message key="config.datatables.search.name"/>";
$('#usersDataTable').dataTable({
"bAutoWidth":true,
"bPaginate": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"bJQueryUI": false,
"sPaginationType": "full_numbers",
"aoColumns": [
null, // Id
null, // Name
{
"mData": null,
"bSortable": false,
"fnRender": function(oObj)
{
return "<a href='" + $.LABDT.url + "users/delete/" + oObj.aData[0] + "'>Excluir</a> | "
+ "<a href='" + $.LABDT.url + "users/" + oObj.aData[0] + "'>Editar</a>";
}
}
],
"bProcessing": true,
"oLanguage": {
"sUrl": $.LABDT.dataTables_LanguageFile,
"sSearch": $.LABDT.dataTables_SearchName
},
"bServerSide": true,
"sAjaxSource": '/labdatatables/users/json/datatables/paginate',
"sServerMethod": "POST"
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment