on filter trigger events

p38

Active Member
Hi,

Is there a way, based a filter selection, that an event is triggered, whereby I can filter another list, based on the current filter values?

So I need to.....
  • Filter a list
  • Trigger an event
  • In this event, I get hold of the filter values.
  • Filter another list using current filter values
Thanks

paul
 
hi

You might be able to use the php events plugin http://fabrikar.com/forums/index.php?wiki/php-events-list-plugin/ with code in the onFiltersGot function to grab the filters from either the request data or the session and inject them into the other lists filter.
If both lists are on the same page the simplest would be to use the JApplication input object to get the filter data

PHP:
$input = JFactory::getApplication()->input;
filters = $input->get('fabrik___filter', array(), 'array');
 
// Get the other list's filters.
$listFilters = $filters['list_8_com_fabrik_8']
$value = $listFilters['value'];
 
$firstFilterValue = $value[1];
$secondFilterValue = $value[2];
 
// Add a filter to the current list model
 
$model->filters['elementid'][] = null;
$model->filters['value'][] = $firstFilterValue;
$model->filters['condition'][] = '=';
$model->filters['join'][] = 'AND';
$model->filters['no-filter-setup'][] = 0;
$model->filters['hidden'][] = 0;
$model->filters['key'][] = $key;
$model->filters['search_type'][] = 'normal';
$model->filters['match'][] = 0;
$model->filters['full_words_only'][] = 0;
$model->filters['eval'][] = 0;
$model->filters['required'][] = 0;
$model->filters['access'][] = 0;
$model->filters['grouped_to_previous'][] = 0;
$model->filters['label'][] = 'Filter label';
$model->filters['sqlCond'][] = 'element = ' . $db->quote($firstFilterValue);
$model->filters['origvalue'][] = $firstFilterValue;
$model->filters['filter'][] = $firstFilterValue;
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top