[updated 24/11/2012] Dependent dropdown (library)
Posted 20 November 2012 - 08:09 AM
Posted 20 November 2012 - 09:30 AM
well, I'll be waiting ...
tu libreria soporta 3 o mas Dependent dropdown?, funciona con uno solo?
disculpa la pregunta es que no he tenido tiempo de revisar tu libreria.
[/quote]
You can use an unlimited number of dependent dropdown.
Posted 20 November 2012 - 10:24 AM
You are really hero.
Thanx your library and support.
Posted 20 November 2012 - 14:07 PM
Another aesthetic detail I saw is when clicking on the cross of parent dropdown, the ajax_loader stays running (should reset all dropdown).
Thanks to all
Posted 20 November 2012 - 16:42 PM
I try to chose from
// first field:
then from
// second field
but then i delete from
// first field: aiax-loader is loading, and in the //second field list is not working.
Like this:
[img]http://s17.postimage.org/qn2ikydm7/image.png[/img]
or this:
[img]http://s10.postimage.org/7czv5m0sp/image.png[/img]
Posted 20 November 2012 - 17:21 PM
Yes, tlc033, there is this a problem. I'll try fix it.
Posted 20 November 2012 - 22:31 PM
I have made it a few days [b]before[/b] I saw your lib.
/topic/1046-ajax-requery-on-addedit-form/
Can you spot what the problem is?
Thank you.
Posted 21 November 2012 - 07:40 AM
Posted 21 November 2012 - 08:26 AM
Where do I download it from?
Posted 21 November 2012 - 09:30 AM
Posted 21 November 2012 - 09:35 AM
you can download it on the first page(the first post of this topic)
[/quote]
Thanks a lot!
If you manage at some point to implement the extra feature when the 'title' => '{day} {hour} {description}' looks something like this would be great!
I am looking also in to it...
Thanks!
Posted 21 November 2012 - 09:53 AM
Posted 22 November 2012 - 09:36 AM
I need to 2 dependent dropdown menu.
Whats the technique?
I try but only the last one work.
My code is below
$fields = array(
// first field:
'category_id' => array( // first dropdown name
'table_name' => 'category', // table of country
'title' => 'country_title', // country title
'relate' => null // the first dropdown hasn't a relation
),
// second field
'subcategory_id' => array( // second dropdown name
'table_name' => 'sub_category', // table of state
'title' => 'subcategory_name', // state title
'id_field' => 'id', // table of state: primary key
'relate' => 'category_id', // table of state:
'data-placeholder' => 'Select Subcategory' //dropdown's data-placeholder:
)
);
$fields = array(
// first field:
'zone_id' => array( // first dropdown name
'table_name' => 'zone', // table of country
'title' => 'country_title', // country title
'relate' => null // the first dropdown hasn't a relation
),
// second field
'subzone_id' => array( // second dropdown name
'table_name' => 'sub_zone', // table of state
'title' => 'subzone_name', // state title
'id_field' => 'id', // table of state: primary key
'relate' => 'zone_id', // table of state:
'data-placeholder' => 'Select Subzone' //dropdown's data-placeholder:
)
);
Posted 22 November 2012 - 09:39 AM
Posted 22 November 2012 - 09:42 AM
field 1
field 2
----------------------------
menu 1
menu 2
---------------------------
.....
....
other fields
....
....
____________
menu 3
menu 4
-------------------
Posted 22 November 2012 - 09:51 AM
I need the technique when use two dependent dropdown.
Like:
1.Input field "subzone_name" depends on field "zone_name".
2.Input field "subcategory_name" depends on field "category_name".
Thanks.
Posted 22 November 2012 - 09:56 AM
$fields = array(
// first field:
'category_id' => array( // first dropdown name
'table_name' => 'category', // table of country
'title' => 'country_title', // country title
'relate' => null // the first dropdown hasn't a relation
),
// second field
'subcategory_id' => array( // second dropdown name
'table_name' => 'sub_category', // table of state
'title' => 'subcategory_name', // state title
'id_field' => 'id', // table of state: primary key
'relate' => 'category_id', // table of state:
'data-placeholder' => 'Select Subcategory' //dropdown's data-placeholder:
)
);
$config = array(
// your config
);
$categories = new gc_dependent_select(&$crud, $fields, $config);
$js = $categories->get_js();
$fields2 = array(
// first field:
'zone_id' => array( // first dropdown name
'table_name' => 'zone', // table of country
'title' => 'country_title', // country title
'relate' => null // the first dropdown hasn't a relation
),
// second field
'subzone_id' => array( // second dropdown name
'table_name' => 'sub_zone', // table of state
'title' => 'subzone_name', // state title
'id_field' => 'id', // table of state: primary key
'relate' => 'zone_id', // table of state:
'data-placeholder' => 'Select Subzone' //dropdown's data-placeholder:
)
);
$config2 = array(
// your config
)
$categories2 = new gc_dependent_select(&$crud, $fields2, $config2);
$js2 = $categories2->get_js();
$output = $crud->render();
$output->output.= $js.$js2
Posted 22 November 2012 - 10:31 AM
Only the first one is work, the last one is hang.
Image:[attachment=368:2nd.png]
Posted 22 November 2012 - 10:34 AM
Posted 22 November 2012 - 10:51 AM
$fields1 = array(
// first field:
'category_id' => array( // first dropdown name
'table_name' => 'category', // table of country
'title' => 'country_title', // country title
'relate' => null // the first dropdown hasn't a relation
),
// second field
'subcategory_id' => array( // second dropdown name
'table_name' => 'sub_category', // table of state
'title' => 'subcategory_name', // state title
'id_field' => 'id', // table of state: primary key
'relate' => 'category_id', // table of state:
'data-placeholder' => 'Select Subcategory' //dropdown's data-placeholder:
)
);
$fields = array(
// first field:
'zone_id' => array( // first dropdown name
'table_name' => 'zone', // table of country
'title' => 'zone_name', // country title
'relate' => null // the first dropdown hasn't a relation
),
// second field
'subzone_id' => array( // second dropdown name
'table_name' => 'sub_zone', // table of state
'title' => 'subzone_name', // state title
'id_field' => 'id', // table of state: primary key
'relate' => 'zone_id', // table of state:
'data-placeholder' => 'Select Subzone' //dropdown's data-placeholder:
)
);
$config1 = array(
'main_table' => 'zone_allocate_subzone',
'main_table_primary' => 'id',
"url" => base_url() .'index.php/'. __CLASS__ . '/' . __FUNCTION__ . '/',
'ajax_loader' => base_url() . 'ajax-loader.gif' // path to ajax-loader image. It's an optional parameter
);
$categories1 = new gc_dependent_select($crud, $fields1, $config1);
//$output = $categories->render();
$js1 = $categories1->get_js();
$fields2 = array(
// first field:
'zone_id' => array( // first dropdown name
'table_name' => 'zone', // table of country
'title' => 'zone_name', // country title
'relate' => null // the first dropdown hasn't a relation
),
// second field
'subzone_id' => array( // second dropdown name
'table_name' => 'sub_zone', // table of state
'title' => 'subzone_name', // state title
'id_field' => 'id', // table of state: primary key
'relate' => 'zone_id', // table of state:
'data-placeholder' => 'Select Subzone' //dropdown's data-placeholder:
)
);
$config2 = array(
'main_table' => 'zone_allocate_subzone',
'main_table_primary' => 'id',
"url" => base_url() .'index.php/'. __CLASS__ . '/' . __FUNCTION__ . '/',
'ajax_loader' => base_url() . 'ajax-loader.gif' // path to ajax-loader image. It's an optional parameter
);
$categories2 = new gc_dependent_select($crud, $fields2, $config2);
//$output = $categories->render();
$js2 = $categories2->get_js();
$output = $crud->render();
$output->output.= $js1.$js2;
$this->badc_output($output);