function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Soumya BeheraSoumya Behera 

How to know about the sort of the UI item in the controller ? Using sortable JQuery in UI.

Hi All,

I am tryging to update the sort order which user will change in the UI. Please let me know how my visualforce controller get to know the the sorting order. 

Regards,
Soumya Behera
gyani19901.3956550919266765E12gyani19901.3956550919266765E12
Hi Soumya ,
For sorting column in vf page please use the javascript.
 
<apex:includescript value="//code.jquery.com/jquery-1.11.1.min.js" / >
        <apex:includescript value="//cdn.datatables.net/1.10.4/js/jquery.dataTables.min.js" />
        <apex:stylesheet value="//cdn.datatables.net/1.10.4/css/jquery.dataTables.css" />
        
        <script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="contacttable"]').DataTable({
                    "order": [],
                    "columnDefs": [ {
                      "targets"  : 'no-sort',
                      "orderable": false,
                      type: 'date-MM/DD/yyyy',                       
                    }]
                });
                
            });
        </script>

Thanks 
Gyani
http://www.mirketa.com
Soumya BeheraSoumya Behera
Hey Gyani,

Thank you for your reply.

I am able to change the order (sequence) of the item in the VF page . My question was regarding the same sequence need to update in the backend. like if i will have backend field Sequence__c than based on the UI changes , i need to update the sequence__c field value.

Please let me know if you have any solution on the above.

Really appriciate for you time to aswer the above.

Regards,
Soumya Behera