Welcome, Guest
Username: Password: Remember me

TOPIC: How to link from Item view to a another tableview

How to link from Item view to a another tableview 30 Jan 2012 16:21 #1132

  • dannyboy
  • dannyboy's Avatar
  • Offline
  • New Member
  • Posts: 5
  • Karma: 0
Hi

I have made a, for me big component with 8 tables and more are comming, but I have a problem with linking the way I want.

I have a table with teams and it works perfectly, I also have a table with riders that also works perfektly. I have made a filter that sorts riders according to their team.

What I would like to do is to make a link from the itemview of the team so that it will show the riders in that team as a grid.

Is that possibly and how do I do it.
The administrator has disabled public write access.

Re: How to link from Item view to a another tableview 30 Jan 2012 22:46 #1136

  • iconvisual
  • iconvisual's Avatar
  • Offline
  • Senior Member
  • Keen Joomla! 1.7 Developer
  • Posts: 53
  • Thank you received: 5
  • Karma: 1
Looking to do the same thing! I have 30+ Tables :-) and much more to add, but I also would like to be able to have an FrontEnd Collection or FrontEnd Item that when one is selected, displays another Grid or Fly on the same page. (List of Properties - houses, select one, display Property - house Item, maybe in Fly, maybe in Form).
Is that similar to what you want to achieve?

Ed.
Keen Joomla! and PHP/MySQL developer. Excited about J-Cook.
The administrator has disabled public write access.

Re: How to link from Item view to a another tableview 31 Jan 2012 05:57 #1139

  • mossss
  • mossss's Avatar
  • Offline
  • Premium Member
  • Posts: 100
  • Thank you received: 7
  • Karma: 9
I have had some success at getting a form and a grid onto the same page. Just a matter of combing the two. The way I did it was:

if your table is called property

Within a list view (propertys), copy the propertyslist.php, propertyslist_items.php, propertyslist_filters.php and propertyslist.xml to propertyslistitem.php, propertyslistitem_items.php, propertyslistitem_filters.php and propertyslistitem.xml respectively.

Then, from the property view, copy the propertyitem_form.php to the propertys view with the name propertyslistitem_form.php.

These files will create your new combined form and grid layout.

Then edit the propertyslistitem.php to load first the form, then the toolbar then the items layouts.


Then in the view.html for the propertys view, create a function for the propertyslistitem, just combine all the required elements from both the form and the grid.

Then in the models, copy propertys.php to propertyslistitem.php.

Then edit the new model file if you need to change the query in any way.


You can also combine the filters if you need them. I also overode the id on the form and removed the input box.

This also works in exactly the same way with a fly rather than a form.

I also don't see why this approach wouldn't work with combining two different grids onto the same page, but I have not had the need to try that....yet.

The one problem that I still do have is that when I use the toolbar to create a new item in the grid, it goes fine to the add item form, but then when I save, it returns to the default grid view for the table instead of the combined form/grid that it came from. Its functional, but would be much nicer if it did return back to the combined layout. Or even better, would be nice if adding to the table could be done in a modal window.

I hope that gives you a bit of a pointer, if you try but cannot get it to work, then I'll try to put some more detail when I have some time.
Last Edit: 31 Jan 2012 06:10 by mossss.
The administrator has disabled public write access.
The following user(s) said Thank You: twev
Time to create page: 0.099 seconds

Get Started