+ Start a Discussion
baaskarbaaskar 

Has StandardSetController class associate with default sorting function?

I am using the StandardSetController class for one of the page in my org. I able to fetch data from the force.com DB. Pagination also was working fine till I try to implement custom sorting function for the table data. Either one of the functions is not working at the same time. Can anyone help me out of this issue. Is there any default method available to sort table data using the StandardSetController class.

 

Thanks in advance.

 

baaskar subramanian

Best Answer chosen by Admin (Salesforce Developers) 
Pradeep_NavatarPradeep_Navatar

No there is no StandardSetController  function for sorting. You can see all the available function of StandardSetController class in http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm

You should implement your Own pagination method without using the StandardSetController class and after that implement the sorting part. Refer http://salesforcesource.blogspot.com/2008/11/adding-sorting-capability-to.html .

Refer http://salesforcesource.blogspot.com/2008/09/how-to-support-paging-of-data-in-your.html to Implement the pagination without set controller.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.


All Answers

ScoobieScoobie

Have you considered doing the sort in the data retrieval using the ORDER BY clause in your DML?

Pradeep_NavatarPradeep_Navatar

No there is no StandardSetController  function for sorting. You can see all the available function of StandardSetController class in http://www.salesforce.com/us/developer/docs/pages/Content/apex_pages_standardsetcontroller.htm

You should implement your Own pagination method without using the StandardSetController class and after that implement the sorting part. Refer http://salesforcesource.blogspot.com/2008/11/adding-sorting-capability-to.html .

Refer http://salesforcesource.blogspot.com/2008/09/how-to-support-paging-of-data-in-your.html to Implement the pagination without set controller.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.


This was selected as the best answer