⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

populate set field_type value from database [SOLVED]



heruprambadi

heruprambadi
  • profile picture
  • Member

Posted 16 July 2013 - 04:19 AM

hi there ! i have a question.

is that possible to populate set field_type value from database ?

so it's like when we use set_relation, we get dropdown field value from database.


davidoster

davidoster
  • profile picture
  • Member

Posted 16 July 2013 - 07:12 AM

These are multiple questions!

Q1. populate the field_type for a set field with values from the database

A1. Yes make a custom model

 

Q2.  use the field_type on a set_relation?

A2. I don't know how to do this. But I know how to use a custom model to fill in the dropdown list of a set_relation with the values I want

 

Q3. on a set_relation have a set instead of a dropdown

A3. As the documentation says, "Set a relation 1-n database relation. This will automatically create a dropdown list to the fields and show the actual name of the field and not just a primary key to the list"

So unless you hack the core of the GC library (or someother fancy jQ way) you will always get a dropdown list


heruprambadi

heruprambadi
  • profile picture
  • Member

Posted 16 July 2013 - 08:08 AM

whoops ! ok, These are multiple questions. sorry about that.

so.. could you show me an example model ?

to be honest, i dont really understand how to use custom model with grocerycrud.


davidoster

davidoster
  • profile picture
  • Member

Posted 16 July 2013 - 08:58 AM

/topic/1578-filter-relation-using-third-table/#entry6865


heruprambadi

heruprambadi
  • profile picture
  • Member

Posted 16 July 2013 - 15:58 PM

it wooorks ! thank you so much :D