I am trying to do just as it is written on the library, and I have an identical case, countries, states and cities and another table, so it should be straightforward, yet .. I am not coming on

I have the 3 tables:
countries,
regions
towns
then I have another table called attributes which has, as foreign keys, the primary keys of each of these 3 tables, id_country, id_region, id_town
Then the names of the dropdowns are:
countries, for countries
regions, for regions
towns for cities
And also the tables for countries states and cites are interrelated the same way that it is shown in the library.
I have then the following code:
$crud->set_relation('id_country', 'country', 'name_country'); $crud->set_relation('id_region', 'regions', 'name_region'); $crud->set_relation('id_town', 'towns', 'name_town'); $this->load->library('gc_dependent_select'); $fields = array( // first field: 'countries' => array( // first dropdown name 'table_name' => 'countries', // table of country 'title' => 'name_country', // country title 'relate' => null // the first dropdown hasn't a relation ), // second field 'regions' => array( // second dropdown name 'table_name' => 'regions', // table of state 'title' => 'name_region', // state title 'id_field' => 'id_region', // table of state: primary key 'relate' => 'id_country', // table of state: id_pais es la foreign key de paises 'data-placeholder' => 'select state' //dropdown's data-placeholder: ), // third field. same settings 'towns' => array( 'table_name' => 'towns', 'order_by'=>"name_town DESC", // string. It's an optional parameter. 'title' => 'id: {id_town} / city : {name_town}', // now you can use this format ))) 'id_field' => 'id_town', 'relate' => 'id_region', 'data-placeholder' => 'select city' ) ); $config = array( 'main_table' => 'atributes', 'main_table_primary' => 'id_atribut', #"url" => base_url() . __CLASS__ . '/' . __FUNCTION__ . '/', 'atributos_Copy'/'atributs_code' "url" =>base_url() . '__atributos_Copia__' .'/' .'__atributos_codigo__'. '/', ); $categories = new gc_dependent_select($crud, $fields, $config); //$output = $categories->render(); // the second method: $js = $categories->get_js(); $output->output.= $js;
I am not sure if I have interpreted the sample correctly, but what happens is that when I click on the pencil for example to update the data, it takes 3 minutes to open the panel and the select lists are not interconnected, if I move one, the other doesnt notice, also the text editor is gone, there is no formatting headers etc, so the page is very much screwed, I dont know if I have to replace the "main_table" and "table_name" by the actual name of MY tables, but I did that and made no difference.