⚠ In case you've missed it, we have migrated 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 is an archived forum. ⚠

  •     

profile picture

Filtering crud by a dropdown



chest94
  • profile picture
  • Member

Posted 09 December 2014 - 14:32 PM

Hi, everybody.

 

I'm new at php, CI and GC but I've found this tools really awesome.

 

Now I have a question and it's very simple but I can't find myself through it.

 

I need a crud to be filtered by a dropdown where the user can select an item and the crud will be filtered by the id the user select.

 

I hope than someone can help me. 

 

[attachment=873:dropdown.png]


Paul Savostin
  • profile picture
  • Member

Posted 07 January 2015 - 23:11 PM

Hi there. So you can do next

 

1)Create select on the page and send order parameters with form for example with post

2)When choose value from dropdown send form order parameter and write it to session and redirect back.
3)By this order param do ordering output in grocery crud

Thats it!


Amit Shah
  • profile picture
  • Member

Posted 08 January 2015 - 06:55 AM

thats correct Paul - but if there is a requirement only to have a single dropdown then here is a simpler solution

/topic/1067-updated-14112012-grid-view-with-dropdown-list-of-categories-in-header-library/


Paul Savostin
  • profile picture
  • Member

Posted 10 January 2015 - 00:51 AM

WOW! Thanks Amit!

 

And this is if i understood correctly not working in datatables? :D