⚠ In case you've missed it we are migrating to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠



  • Please log in to reply
1 reply to this topic

#1 viraj

viraj

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 04 June 2012 - 11:32 AM

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

#2 fieldju

fieldju

    Member

  • Members
  • PipPip
  • 14 posts

Posted 05 June 2012 - 07:41 AM

The ordering can be done with http://www.grocerycr...ctions/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





Also tagged with one or more of these keywords: grid sorting, sorting, sorting functionality, Grocery crud sorting, enabling sorting in g crud

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users