⚠ 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

Dropdown menu



mieszkos
  • profile picture
  • Member

Posted 25 November 2013 - 10:11 AM

(Please delete one topic because I got lag when I was posting and it goes 2 times)

 

Hi all, I'm new here and I'm very happy to use Grocery Crud for CI but I have a problem

I want to make dropdowns lists like

 

Province (you are choosing province) then you are reciving District list and when you will get commune list, a read some topics here about making categories -> subcategories but I think its not for my DB Structure... so I have in my database table called Offers (there are some products) and I have table called OffersCommunes where I have 3 fields -> id_offer, id_commune,id_district

 

and I also have tables like province(id,name), provinceDistrict(id_province,id_district),district(id,name),districtCommune(id_district,id_commune),communes(id,name)

 

Can someone tell me how can i make for this dropdowns list ?

 

I want to have something like this http://demo.edynamics.co.za/grocery_crud/index.php/examples/customers_management/add

but for my DB structure, please help me and a lot of thanks! :)


Racing Chocobo
  • profile picture
  • Member

Posted 25 November 2013 - 12:51 PM

Hi, you can put all of the option of the state/province and the city/town in the javascript variable while rendering to your current page,

then change the option list every after the country selected value is change (by using jquery .change() function is one way)


Amit Shah
  • profile picture
  • Member

Posted 28 November 2013 - 13:02 PM

Well the same i believe is an example from the earlier post here

 

It is shared with the example - or you can download the code and adjust the same to your requirement

 

There is another one here which is more simple to use. I will recommend you hunt down a solution on the last link provided ... much easy to go and much easy to work with.

 

Happy GCing:)