Welcome, Guest
Username: Password: Remember me

TOPIC: Create link to different table

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

  • arnar
  • arnar's Avatar
  • Offline
  • Junior Member
  • Posts: 20
  • Thank you received: 1
  • Karma: 0
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
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
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
The administrator has disabled public write access.
Time to create page: 0.094 seconds

Get Started