Showing posts with label Visualforce Pagination. Show all posts
Showing posts with label Visualforce Pagination. Show all posts

Tuesday, June 25, 2013




Well here is a much awaited and the needed update for the PageBlockTable Enhancer plugin. Ever since I coded the first version, there were request for many features and this 2.2 version brings down some of them.

Here is what is new with this plugin
  1. Parameter to turn on and off Pagination.
  2. Support for specifying available page sizes.
  3. Support for choosing default page size on page load.

List o Parameters
  • targetPbTableIds : comma-separated Ids of the target Pageblock tables
  • paginate : Assign true if you want to use the pagination feature,default value is true.
  • pageSizeOptions : A comma seperated list of integer values that will displayed as dropdown for page size
  • defaultPageSize : Default page size that needs to be selected (at page load).
Ajax/Rerender support
  • This version brings in support for rendering, the earlier version wasn't able to handle this. So incase you are rerendering your table or the parent components, you can call the "initPageBlockTableEnhancer()" method from "oncomplete" even of your commandButtons/actionFunctions/actionSupport/commandLink .

    <apex:commandButton value="Rerender" reRender="mid" oncomplete="initPageBlockTableEnhancer()"/>
Basic Syntax
The basic syntax remains same, just few added params.

<c:PageBlockTableEnhancer targetPbTableIds="mid,mid2" paginate="true" defaultPageSize="5" pageSizeOptions="5,10,20,30,40,50,100"/>    
   <apex:pageBlock >   
     <apex:pageBlockTable value="{!accounts}" var="acc" id="mid">   
      <apex:column value="{!acc.Name}"/>   
     </apex:pageBlockTable>    
     <apex:pageBlockTable value="{!accounts}" var="acc" id="mid2">   
      <apex:column value="{!acc.Name}"/>   
     </apex:pageBlockTable>     
   </apex:pageBlock>  


Demo And Installation / Unmanaged Package: http://blogforce9dev-developer-edition.ap1.force.com/ProjectDetail?id=a0290000007rdwd
[Updated @ 27-Nov-2013 :  Bug Fixes related to sorting]

Thursday, February 28, 2013


[Update : Have a look at awesome new PageblockTable Enhancer Component here]


Well I am really happy that finally my work on Enhanced Pageblocktable is almost complete.The Sortable Pageblocktable component is now Enhanced Pageblock table with added functionality of pagination , athough the Sortable Pageblocktable component still exists.

Now you can add functionality like pagination, sorting without any extra coding.The component uses the jQuery table sorter plugin to add the sorting and pagination features to the page block tables.

Features of Enhanced Pageblock Table

  • Sorting : Supports sorting of columns by clicking at the column header.



  • Pagination : Supports client side pagination of the table.
  • Native Look And Feel : Enhanced Pageblock table component uses the similar look and feel of a standar pageblock table and mixes with the existing UI easily.

How to use? 
Pretty Simple!, just use the below code.

Parameters
sObjList : List of sObject To display
fieldList : List of field API names to display in the table as column.


<c:EnhancedPageBlockTable sObjList="{!accounts}" fieldList="{!fields}"/>