Created
September 20, 2014 14:51
-
-
Save keirbowden/f30ebd66c0e5a5008dbf to your computer and use it in GitHub Desktop.
Demo page for Visualforce and tablesorter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<apex:page sidebar="true" controller="TableSortingCtrl"> | |
<apex:includeScript | |
value="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js" /> | |
<apex:includeScript | |
value="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.17.8/js/jquery.tablesorter.min.js" /> | |
<apex:stylesheet | |
value="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.17.8/css/theme.blue.css" /> | |
<apex:datatable value="{!accounts}" var="acc" id="accsTable" styleclass="tablesorter"> | |
<apex:column headerValue="Created"> | |
<apex:outputText value="{0, date, dd/MM/yyyy}"> | |
<apex:param value="{!acc.CreatedDate}" /> | |
</apex:outputText> | |
</apex:column> | |
<apex:column headerValue="Name"> | |
<apex:outputField value="{!acc.Name}" /> | |
</apex:column> | |
<apex:column headerValue="Street"> | |
<apex:outputField value="{!acc.BillingStreet}" /> | |
</apex:column> | |
<apex:column headerValue="City"> | |
<apex:outputField value="{!acc.BillingCity}" /> | |
</apex:column> | |
<apex:column headerValue="State"> | |
<apex:outputField value="{!acc.BillingState}" /> | |
</apex:column> | |
<apex:column headerValue="Postcode"> | |
<apex:outputField value="{!acc.BillingPostalCode}" /> | |
</apex:column> | |
</apex:datatable> | |
<script> | |
$(document).ready(function() | |
{ | |
$("[id$='accsTable']").tablesorter({theme: 'blue', dateFormat : "dd/mm/yyyy"}); | |
}); | |
</script> | |
</apex:page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment