Hi there,
I am very new to GC and I am trying to edit a table with the following data:
CITY TABLE
id_city = Int, Primary key
city = varchar
id_country = FK into country table, Int
COUNTRY TABLE
id_country = Int, Primary key
country = varchar
The code to show this is:
$crud = new grocery_CRUD(); $crud->set_theme('datatables'); $crud->set_table('tw_city'); $crud->set_relation('id_country','tw_country','country'); $crud->set_subject('City'); $crud->columns('id_city','city','id_country'); $output = $crud->render(); $this->_example_output($output);
It shows the data correctly, but when I click EDIT it does not fill in the dropbox for the country field. What is odd is that if I select VIEW, it correctly shows the country associated with the selected item.
As far as I can see, I have set things up correctly.
Can anyone explain why the country dropdown does not fill on the edit page?
Thank you!
Yours,
JMB