Auto creation of dropdown box using foreign key?
I have done some researches before post. However the knowledge base seem still quite limited and hard for a beginner like me. For example now if i am creating a review module which is related to a product, so in the module i wrote
public $foreign_keys = array('product_id'=>'products_model');
In the create form of review, product id is displayed as a dropdown box. However it seems display the first two fields values of the table with id as value of the select and second column as the name of the select.
But i actually wanted to display the name of product which is located at the third column of the table
How can i customize this? Thanks
Comments
public function options_list($key = NULL, $val = NULL, $where = array(), $order = TRUE) { if (empty($val)) $val = 'my_column'; return parent::options_list($key, $val, $where, $order); }