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

TOPIC:

Subform?? 03 Jul 2013 04:35 #7813

Is it possible to design a form that has one table up top and the grid on the bottom? For example. I have a games table that gives me the basic set up of the event. Then all of the player finishing positions in the bottom GRID. Like a leaderboard. They would all be part of the same event so rather than having to select an event with each entry, just tie them to that event?

Did I just loose everyone?

Any help would be appreciated.

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

Subform?? 03 Jul 2013 22:22 #7834

  • VeCrea
  • VeCrea's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Absolute JCook fan
  • Posts: 473
  • Thank you received: 100
What design do you use for your table in cook ? Is the EVENT and the RESULTS for that event in the same table ?
Hope i'm not lost ;-)

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

Subform?? 06 Jul 2013 04:22 #7889

No. The events details are in one table while the results of that event (many results for one event) are in another table.

I don't want a user to have to select an event with EVERY result they put in. So for example. If a user selects an Event. A full form would open where the event details like the Date of the event, description, location etc would available. Then below, maybe in a grid, would be where all of the results from that event would be listed. Visually, I would say, to think of an Invoice. All of the main details up top and all the items for that one invoice below.

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

Last edit: by dniezby. Reason: typo...

Subform?? 07 Jul 2013 10:21 #7899

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
In this case do not think the way 'merging' 2 layouts.

Learn the view part and template and realize it from scratch.
- view.html.php is loading the php objects
- template file is showing the html rendering.

Choose a layout and empty it.
Base this layout on the 'Invoice' item layout in your example.
Then, the view file will load the invoice in $this->item, but you are not limited, you can fill new vars and send them to the layout.
When you want to do a PDF or an export, it is the same. You prepare the datas first in the view file.

In the view, you can load whatever models you want (see how the FK are loaded in forms)
Just understands how the model works (loading datas), and how JDom works (rendering the datas)
That's easy.

Even better, you can create N:M (in the model)
It means that Invoice will contain an array objects containing the sub items.
Place the code in populateObjects() of the model, and execute it only if the model has received a state value for that.
This is the really short description of the N:m tutorial.

Hope it helps.
And remember alway to write in the 'fork' files.
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.058 seconds

Just wanted to congratulate you on the J-Cook website / web development tool. In a couple of visits I've had a play around with Cook and have to say I think it is fantastic.  I've played with a number of component builders in the past and yours is certainly looking like the best so far. I'd also like to help you spread the word - I'm really surprised more people aren't excited about this tool. Good luck with the project.
Dean

Get Started