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.076 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started