Select another...

edited November 2011 in News & Announcements
I am getting ids in the dropdowns on list page - how do I override to have some other column instead of Id in the dropdowns.

I also want to filter only those which belong to logged in user.


  • edited 7:36PM
    Method signature for options list is:

    options_list($key = NULL, $val = NULL, $where = array(), $order = TRUE)

    If you don't supply a key or val it'll use the first field after the id. I guess you have foriegn keys in this table?

    try, options_list('id', 'your_name_field', array('id' => $your_logged_in_user), $order = TRUE).

    Not sure what context you have this problem in. A good example of this is the form_fields() method of the blog_posts_model in the blog module.
  • edited 7:36PM
    Thanks that worked.
Sign In or Register to comment.