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.073 seconds

Amazing Tool !
And only tool I know that allows complete Scaffolding in terms of component creation. It really saves loads of time (actually much more than that). Simple architecture enables quick and painless changes at any time. Code is clean and consintent. It's just... what's the word... neat! :) Great work! You should definetely try this one!

pi_wo (JED)
         

Get Started