Here I wrote some code for you..VF Page : <apex:page controller="testPageController"> <apex:includeScript value="{!URLFOR($Resource.sorter, '/jquery-latest.js')}"/> <apex:includeScript value="{!URLFOR($Resource.sorter, '/jquery.tablesorter.min.js')}"/> <apex:pageBlock> <apex:pageBlockTable value="{!accList}" var="acc" styleClass="accTable"> <apex:column value="{!acc.Id}"/> <apex:column value="{!acc.Name}"/> </apex:pageBlockTable> </apex:pageBlock> <script> $(document).ready(function() { $(".accTable").tablesorter(); }); </script> </apex:page>Controller : public class testPageController{ public List<Account> accList{get;set;} public testPageController(){ accList = [select id,name from account]; } }Just download the zip file from "http://tablesorter.com/__jquery.tablesorter.zip" , rename the zip file as "sorter.zip" , create a static resource named "sorter" and upload this zip file there then this code will work.
답변 4개