Welcome, Guest
Username: Password: Remember me

TOPIC: Context Layout

Context Layout 21 Apr 2012 15:29 #2097

  • liubov
  • liubov's Avatar
  • Offline
  • Elite Member
  • (=) 10 mn and it's ready!
  • Posts: 278
  • Thank you received: 35
  • Karma: 22
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.
Last Edit: 21 Apr 2012 16:01 by liubov.
The administrator has disabled public write access.

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

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
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
The administrator has disabled public write access.
Time to create page: 0.101 seconds

Get Started