Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Create link to different table 24 Jul 2014 23:07 #12535

  • arnar
  • arnar's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 20
  • Thank you received: 1
Hi,

Is it possible to create a link to different table.

For example I have Tables A and B. Table B contains a link to A. (b.aid = a.id)

Now in a gridview for Table B i want to get all instances of B that refer to that particular A.

Can anyone help me with that ?

regards
Arnar

Please Log in or Create an account to join the conversation.

Create link to different table 26 Jul 2014 10:50 #12536

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Use a simple filter.

On the table B, create a compo filter based on A (FK). Drag a sub field of the FK node. (To display text values in the combo)
Then, you can call this page in various ways.

- The user set the filter value
- The link of the page specify it (...&filter_myfk=33)
- The menu item set it automatically (In the menu item setup)
- a small PHP code filter the model : $model->setState('filter.myfilter', 33)

There are many ways...
Also you can group the grid B depending of the FK value
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.052 seconds

Dear Cook Team Firstly a massive thank you for your wonderful service!
audibleid (Forum)  

Get Started