dropdown dependents

79 views
Skip to first unread message

César Barreno

unread,
Apr 12, 2013, 6:59:46 PM4/12/13
to agile-too...@googlegroups.com
Hello friends a pleasure to be around here, I'm new to this framework and I have a few doubts about how to make dependent dropdown, for example, I have a list of countries and select a country to show me their states hope I can help from already thank you very much.

Gowrav Vishwakarma

unread,
Apr 15, 2013, 10:57:43 PM4/15/13
to agile-too...@googlegroups.com
Try this snippet ..
      
        $form=$this->add("Form",null,null,array('form_horizontal'));
        $country_field=$form->addField('dropdown','country')->setEmptyText("Select Country");
        $country_field->setModel("Country");

        $state_field=$form->addField('dropdown','state')->setEmptyText("Select State");

        $s=$this->add("Model_State");

        $form->addSubmit('Save');

        if($_GET['country_selected']){
            $s->addCondition('country_id',$_GET['country_selected']);
        }

        $student_field->setModel($s);

       $country_field->js('change',$form->js()->atk4_form('reloadField','state',array($this->api->url(),'country_selected'=>$country_field->js()->val())));

Romans Malinovskis

unread,
Apr 16, 2013, 7:26:35 AM4/16/13
to agile-too...@googlegroups.com
Hey Gowrav!

I'm really excited to see you posting in the list again. Welcome back.

There was an old demo for Agile Toolkit 3.9 which I believe is still usable.

http://demo39.agiletoolkit.org - look for "conditional fields" which uses javascript function inside univ() to hide and show field. It's just a simple implementation, you can easily implement something yourself in JavaScript.

The suggested method with field reloading was also on that demo-site under "Country and County" section if I remember it correctly (no internet connection now)

Welcome to our community and I hope you find it helpful here.

Regards,
Romans
> --
> You received this message because you are subscribed to the Google Groups "Agile Toolkit Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to agile-toolkit-d...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Imants Horsts

unread,
Apr 16, 2013, 11:54:53 AM4/16/13
to agile-too...@googlegroups.com
This is what Romans told about: http://demo39.agiletoolkit.org/demo.html?t=20

And this is probably your post in Stackoverflow about same thing:
http://stackoverflow.com/questions/15982705/dropdown-dependents-agile-toolkit

Gowrav Vishwakarma

unread,
Apr 16, 2013, 2:46:55 PM4/16/13
to agile-too...@googlegroups.com
:)
--
Regards

Gowrav Vishwakarma
Man of Affairs, Digital Vish, Xavoc International
http://www.digitlavish.com : +91 9783807100
http://www.xavoc.com

--------------------------------------------------------------------
Never Never Never Never Never Never Never Never Never Never Never Never Never Never Never  GIVE UP
Reply all
Reply to author
Forward
0 new messages