Jump to content


Filtering crud by a dropdown

filter crud

  • Please log in to reply
3 replies to this topic

#1 chest94

chest94

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 09 December 2014 - 02: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. 

 

dropdown.png



#2 Paul Savostin

Paul Savostin

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationUkraine

Posted 07 January 2015 - 11: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!



#3 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

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

http://www.grocerycr...header-library/



#4 Paul Savostin

Paul Savostin

    Advanced Member

  • Members
  • PipPipPip
  • 229 posts
  • LocationUkraine

Posted 10 January 2015 - 12:51 AM

WOW! Thanks Amit!

 

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







Also tagged with one or more of these keywords: filter, crud

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users