⚠ 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

Set relation show id and description (as separated) fields



sarp

sarp
  • profile picture
  • Member

Posted 25 September 2020 - 11:15 AM

Hi all,

 

In the basic set relation example  I want to show additionally to the Office City the "offices.officeCode" field to the table in a separated column.

 

Can you please help me with a code example?

 

Thank you!

 

 

 

 


stepgr

stepgr
  • profile picture
  • Member

Posted 29 September 2020 - 08:47 AM

I'm no expert on this but you need to either make a callback for this or create a

custom model  . I was just looking for a similar issue I have (you cannot sort the returned

data when using set_relation and fetch a combined column from the related table as the

example) .

Perhaps this post will be of help , I haven't been able to test it myself yet