Sort-able Pageblock Table Component for Visualforce Pages

This Version is no more actively developed and is deprecated. But we have developed two more Alternatives for the same which are much more fun and easy to implement





How many times you have tried to create a Sort-able Page block table?
Well I personally tried the same lot of time but never got a plug n play solution, this always ended up with lots of changes in my controller class.

There are lot of work around Dynamic SOQL,Order by statement, List Sorting etc. Well most of them requires a lot of coding and changes in the visualforce page.
Most of time we need to display just a small list of sortable data ,to implement the same I guess writing apex classes and code is not a good idea.
So I tried writing visualforce component which uses jQuery table sorter to do the job.Well this component is very naive stage and needs some obvious enhancement like, ability to specify which fields to sort, proper images to display the sorting order.

How to use the component?

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

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



This Version is no more actively developed and is deprecated. But we have developed two more Alternatives for the same which are much more fun and easy to implement






Demo.

You can check the live demo from here(http://blogforce9dev-developer-edition.ap1.force.com/SortablePageblocktable)

Package/Installation
You can use this package to install the same in your org https://login.salesforce.com/packaging/installPackage.apexp?p0=04t90000000M3iZ

14 comments:

  1. looks good but just curious any reason to have those * character instead of legendary up and down images..:)

    ReplyDelete
    Replies
    1. @jatin actually tried doing the easiest way. Will be adding the up and down images sometime later. Thanks for the suggestion!

      Delete
    2. No prob.. you have manage the need of the hour!!.. cosmetic changes are jst not important :)

      Delete
    3. @jatin well those enhancements are already in the plan. Will be porting them soon.

      Delete
    4. @jatin I have made changes and now you can see the legendary up and down images in the component :). Check my latest post.

      Delete
  2. Hey can you tell me how to call the component from Visual force page?When I am giving it is throwing error- Unknown property 'fields' referenced in SortJQuesry

    ReplyDelete
    Replies
    1. Well this is not the latest version that you are trying with. You can try the latest version from here(http://blogforce9.blogspot.in/2012/08/sort-able-pageblock-table-component-for_23.html). From the error seems like you are using IE8. Currently there are some problem with IE8 can you please check and confirm the same in other browser like chrome/firefox

      Delete
  3. I am using case standard controller page to post from list view I am not getting any results. what am I doing wrong? My page VF page is posted from case list view

    ReplyDelete
  4. sobject="{!selected}" fieldlist="{!case.Id}
    selected is the name of the list view

    ReplyDelete
    Replies
    1. Probably this component will not work with a standard controller.
      You have to do something like this

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

      Delete
  5. It seems not to work with Date fields.

    ReplyDelete
  6. Not working with boolean values too....

    ReplyDelete
  7. Hi...
    I am using PageBlockTableEnhancerADV in my prjoect.

    I have issue with the table links CSV,EXEL,PDF

    I am Displaying three tabel and i am using the component the links are not working

    ReplyDelete
  8. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from JQuery Training in Chennai . or learn thru JQuery Training . or learn thru ES6 Online Training. Nowadays JavaScript has tons of job opportunities on various vertical industry.

    ReplyDelete