I am trying to set up my Visualforce page to allow a user to sort any of the pageblockTable columns. I cam across some JQuery code that is supposed to allow this to occur. I am not familiar with JQuery and wonder if anyone can help me figure out why this is saving but not changing anything on my page, or if there is a better way for me to enable a sort of my columns? I uploaded the jquery.tablesorter.min.js file as a Static resource from the tablesorter.com/docs website. The original post I found as here: Sorting apex:pageblocktable from 2015.
VF Page:
<apex:page StandardController="Quote__c" recordSetVar="quotes" Extensions="CalculateQLISummary" action="{!init}" tabStyle="Quote__c">
<apex:pageMessages id="pgMess" />
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"/>
<apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"/>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/ui-lightness/jquery-ui.css" type="text/css" media="all" />
<apex:includeScript value="{!URLFOR($Resource.tablesorter, 'jquery.tablesorter.js')}"/>
<script type="text/javascript">
$j = jQuery.noConflict();
$j(document).ready(function () {
$j("[id$=theaddrs]").tablesorter();
});
</script>
<apex:form id="frmReview" >
<apex:PageBlock >
<apex:pageBlockTable title="Quote Summary" value="{!listQLI}" var="OLI" style="width:100%" id="theaddrs" styleClass="tablesorter" headerClass="header">
<apex:column>
<apex:facet name="header">
<apex:outputText styleClass="header" value="{!$ObjectType.Name.Label}"/>
</apex:facet>
<apex:outputField value="{!OLI.Name}"/>
</apex:column>
<apex:column>
<apex:facet name="header">
<apex:outputText styleClass="header" value="{!$ObjectType.Quote_Code__c.Label}"/>
</apex:facet>
<apex:outputField value="{!OLI.Quote_Code__c}"/>
</apex:column>
<apex:column>
<apex:facet name="header">
<apex:outputText styleClass="header" value="{!$ObjectType.List_Price__c.Label}"/>
</apex:facet>
<apex:outputField value="{!OLI.List_Price__c}"/>
</apex:column>
<apex:column>
<apex:facet name="header">
<apex:outputText styleClass="header" value="{!$ObjectType.Final_Price.Label}"/>
</apex:facet>
<apex:outputField value="{!OLI.Final_Price__c}"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>