⚠ 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

Same relation to display two columns from another table



Qarlo

Qarlo
  • profile picture
  • Member

Posted 13 February 2012 - 11:46 AM

Hi,
I need to display two long texts, both in the same table, from a single relation. I mean, inside the table they are in the same row, so they have the same id.

The problem is that I don't like very much the result of this:

$crud->set_relation('caption_id', 'contents', '{italian_text} - {english_text}');

I'd prefer to display them in two different columns.
Is there any way to do this?

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 16 February 2012 - 19:07 PM

Hello Qarlo and sorry for the delayed answer,

For now the only way to do it is to add a custom column callback ( see http://www.google.co...RP5MN_5rsaOaYEA for more ) for the italian text for example but you have to do the query in the callback. This is the easiest (but not the right) way to do it right now.

[b]Note:[/b] At the $crud->columns you can add also columns that not exist, so for example you can add a column with name: italian_language