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.