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

TOPIC:

Context Layout 21 Apr 2012 15:29 #2097

  • liubov
  • liubov's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 279
  • Thank you received: 36
Hi Joce !

In my component, backend side, I use a main filter into the grid on different pages (tabs). So I am correcting the code to keep a global context for these pages. J-cook generate a filter context depending on the layout. I would like to keep the filter value if setted, and auto selected when creating a new item. This is the native behaviour of Joomla with category filter, for example ...

May be it would not be a lot of work to add an filter option when creating the layout pages in j-cook (global or layout).

My solution to use a global filter :

views/pedigrees/view.html.php
		//Filters
		//Race > value
		$model_id_race = JModel::getInstance('races', 'JbreedmModel');
		...   ...
		$this->filters['id_race']->value = $model->getState("filter.id_race");


models/pedigrees.php
		// for $filter_id_race context never change to keep filter on each page ...
		// j-cook line: $filter_id_race = $app->getUserStateFromRequest($this->context.'filter.id_race', 'filter_id_race');
		
		
		$filter_id_race = $app->getUserStateFromRequest('filter.id_race', 'filter_id_race');

what do you think of that ?

Marc.

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

Last edit: by liubov.

Re: Context Layout 22 Apr 2012 18:33 #2102

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Liubov, nice to see you man ;-)

Yes, I had a tought about that, it could be an option.
I keep in list.
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.053 seconds

This Component Generator is the REAL component generator. This tool is very easy to use and in a matter of minutes I was building a fully working extension. I was amazed with the end result... worth every cent...
Griiettner (JED)

         

Get Started