Jump to content


set_relation_n_n adding extra field

set_relation_n_n

  • Please log in to reply
3 replies to this topic

#1 Christopher

Christopher

    Newbie

  • Members
  • Pip
  • 8 posts

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');

 

 



#2 davidoster

davidoster

    Grocery CRUD Ninja

  • Advanced Member
  • PipPipPip
  • 1,068 posts
  • LocationAthens, Greece

Posted 11 February 2013 - 05:32 PM

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


____________________________________________________________

 

rtfm_small.jpg---!!!Please read these guidelines before asking to the forums!!!---

____________________________________________________________

 

David Oster aka George Pasparakis,
http://odphotography.com
http://eletter.gr


#3 Christopher

Christopher

    Newbie

  • Members
  • Pip
  • 8 posts

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



#4 goFrendiAsgard

goFrendiAsgard

    Advanced Member

  • Members
  • PipPipPip
  • 137 posts

Posted 15 February 2013 - 10:36 PM

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


No-CMS homepage : http://www.getnocms.com
No-CMS forum : http://www.getnocms.com/forum
No-CMS Github page : https://github.com/g...diAsgard/No-CMS

 

Please don't mix up No-CMS and groceryCRUD issues.
(eg: user authentication etc is No-CMS specific issue and has nothing to do with groceryCRUD)

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users