⚠ 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_n_n adding extra field



Christopher
  • profile picture
  • Member

Posted 11 February 2013 - 12:04 PM

I have this code 

 

$crud->set_relation_n_n('Employee', 'MessageDetail', 'Employee', 'MessageID', 'EmployeeID', 'FirstName','priority');

 

In employee table , i have two columns 'FirstName' and 'LastName' ,when relating I want to show both fields in the relational table..

 

Therefore instead of just 'FirstName' ,can i do something like this

 

fullName = 'FirstName' . 'LastName';

 

Is this possible to do something like this ?

$crud->set_relation_n_n('Employee', 'MessageDetail', 'Employee', 'MessageID', 'EmployeeID', 'fullName','priority');

 

 


davidoster
  • profile picture
  • Member

Posted 11 February 2013 - 17:32 PM

Use this syntax: '{FirstName} {LastName}'


Christopher
  • profile picture
  • Member

Posted 12 February 2013 - 10:23 AM

That worked . Thank You  :) .

Just one more thing, How to change field_type of set_relation_n_n field to read only mode ?

I guess, field_type wont work


goFrendiAsgard
  • profile picture
  • Member

Posted 15 February 2013 - 22:36 PM

Maybe you can use javascript/css. That's gonna be tricky