In my project there is a dependent dropdown. I want to select multiple data from dropdown sometime all data, and all the data will insert to same table not to many to many relational table. My code is below ---
$this->load->library('grocery_CRUD');
$crud = new grocery_CRUD();
$crud->set_theme('flexigrid');
$crud->set_table('tbl_donation_ppl');
$crud->set_relation('fld_home_id', 'tbl_home_name', 'fld_name');
$crud->set_relation('fld_user_id','tbl_recipient', 'fld_name');
$crud->set_relation('fld_itemgrp_id', 'tbl_donate_group', 'fld_grp_name');
$crud->columns('fld_don_type', 'fld_home_id', 'fld_user_id', 'fld_itemgrp_id', 'fld_date', 'fld_details');
$crud->required_fields('fld_don_type','fld_home_id','fld_user_id', 'fld_itemgrp_id', 'fld_date');
$crud->display_as('fld_done_type', 'Donation Type');
$crud->display_as('fld_home_id', 'Home Name');
$crud->display_as('fld_user_id', 'Receipient');
$crud->display_as('fld_itemgrp_id', 'Donation Item');
$crud->display_as('fld_date', 'Donation Date');
$crud->display_as('fld_details', 'Details');
$crud->change_field_type('fld_don_type', 'dropdown', array('iftar' => 'ইফতার','jakat' => 'যাকাত','home' => 'ঘর'));
$crud->field_type('fld_user_id', 'multiselect');
$fields = array(
//District Field
'fld_home_id' => array(
'table_name' => 'tbl_home_name',
'title' => 'fld_name',
'relate' => null
),
'fld_user_id' => array(
'table_name' => 'tbl_recipient',
'title' => 'fld_name',
'id_field' => 'fld_uid',
'relate' => 'fld_home_id',
'data-placeholder' => 'Select Home'
),
);
$config = array(
'main_table' => 'tbl_home_name',
'main_table_primary' => 'fld_uid',
'url' => base_url() . 'index.php/libraries/makedonationppl/'
);
$usrs = new gc_dependent_select($crud, $fields, $config);
$js = $usrs->get_js();
$output = $crud->render();
$output->output.=$js;
$this->__mycrud($output);
I want to multi select 'tbl_recipient' and add as many row as selected item. But I can select only one item at once to tbl_donation_ppl table, is there any way to achieve it? Thanks in advance.
screenshot here == https://imgur.com/a/yTpee