Welcome, Guest
Username: Password: Remember me

TOPIC: Custom Views

Custom Views 23 Sep 2012 00:28 #3869

  • madaura
  • madaura's Avatar
  • Offline
  • Junior Member
  • Posts: 35
  • Thank you received: 3
  • Karma: 0
Hello,

Inside a component I have the below tables among others:

* Citizens
* Skills
* Professions
* Educational Institutions
* Companies
* Jobs

Its logical relationship is:



I need to create several views in a format grid, like for example To know the trained citizens able to perform X job offered by Y company..

How can do that through Cook?

Thanks a lot for your help...
Last Edit: 03 Oct 2012 13:32 by admin.
The administrator has disabled public write access.

Re: Custom Views 23 Sep 2012 09:57 #3875

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
The results are a list of Citizen.

So, first create a new collection layout with a grid, based on citizen.
Instance all the datas to show from the citizen item, and FKs

Then, in your model, you can see the prepared Query for this layout ( in prepareQuery())
Customize and break it as you want.

In the view file calling this layout, ask for your custom query (trough the state var)
That's it.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: Custom Views 23 Sep 2012 10:03 #3876

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
And for sure, to recieve the parameters from the request, do it in the model predefined profile (still in the same place in prepareQuery())

Alternatively, you can also use the swithers (stateVars), in order to change the behavior of the query.
These states var can be setted in view and read in model (prepareQuery())

If you receive direct values from the url request, the best is to do it directly in model without using these state vars, but you are really free to do what you want.

Create and use the states vars AS YOU WANT, from anywhere in MVC, when the concerned model is available.

Not opened that ?
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.067 seconds

Get Started