Default col

edited February 2016 in Modules
A module's default_col specifies the column to display - for example as the text value in CMS select inputs. I've specified this for a model table where the 2nd column wasn't a suitable display field and using a foreign_keys relationship, the options text value didn't alter to the column specified by default_col.

Moving the column (to the 2nd defined) in SQL did (obviously) fix this, but I thought default_col usually handled that - or is a foreign_key relationship beyond its scope?

Comments

  • edited 6:06AM
    Are you perhaps referring to the "display_field" field instead?
  • edited 6:06AM
    Actually I had both defined with the same column. I see now that display_field is the one I should have referred to.
  • edited 6:06AM
    FUEL will not automatically do the foreign_key relationship and will skip any fields that end with _id when determining the default display_field (if it is not specified in the MY_fuel_modules.php config). To do the foreign_key relationship, I usually will create /add a _common_joins method or add to the _common_query method on the model to add the join and the select statements.
  • edited 6:06AM
    OK - that's interesting - thanks again!
Sign In or Register to comment.