hello  every one
i  have  integrated the grid in my project . The grid works  fine  and  is really   helpful . But there  is one  thing which i  dont know how to  handel . In my project  there is an function of  sorting the  records  once we add  it in the admin pannel of the site  (Eg  if i  add  10 news  record . The admin will have the  right  to decide which one will appear  first second  and third  etc ). The  gcocery  crud  i guess  does not support  sorting of records . can any one  help  me out  with it  how it  can be  achieved  by  grocery  crud
Thanks
                                        
                                    
                                    
                                
    
            Sorting in the grid
                    Started by viraj, 04 June 2012 - 11:32 AM                    
                
                - Single Page
 
Posted 04 June 2012 - 11:32 AM
Posted 05 June 2012 - 07:41 AM
                                        The ordering can be done with http://www.grocerycrud.com/documentation/options_functions/order_by but this function uses data from the database to do the sorting.
so you would give a column and tell it to order_by('column', 'desc') or order_by('column', 'asc')
If you wanted to chose the order yourself would need to have an editable field in the table that would be the order_by value and it would be potentially bigO N every time you changed the order of 1 person
                                    
                                    
                                so you would give a column and tell it to order_by('column', 'desc') or order_by('column', 'asc')
If you wanted to chose the order yourself would need to have an editable field in the table that would be the order_by value and it would be potentially bigO N every time you changed the order of 1 person
