Hi all
I am using dynamic filtering on my page, filtered by season (named: obdobi) .... this variable is in form: YYYY-MM (like 2015-09).
condition is set to all season (named: celé období) on first load page (all data are loaded) and I need set condition to latest season (now 2015-09) but not by sql query.
here is code of dynamic dropdown menu:
But I dont know how to modify this code to get filter to latest value (now 2015-09).
someone knows?
thank you
I am using dynamic filtering on my page, filtered by season (named: obdobi) .... this variable is in form: YYYY-MM (like 2015-09).
condition is set to all season (named: celé období) on first load page (all data are loaded) and I need set condition to latest season (now 2015-09) but not by sql query.
here is code of dynamic dropdown menu:
// button for filtering by date season
$keys = \GCore\Libs\Arr::getVal(\GCore\Libs\Arr::getVal($rows, explode(".", "[n].pk")), explode(".", "[n].obdobi"));
$values = \GCore\Libs\Arr::getVal(\GCore\Libs\Arr::getVal($rows, explode(".", "[n].pk")), explode(".", "[n].obdobi"));
array_unshift($keys, '');
array_unshift($values, 'celé období');
$options = array_combine($keys, $values);
$field = array
(
'name' => 'fltr[pk][obdobi]',
'id' => '',
'options' =>
array (
),
'empty' => '',
'values' =>
array (
),
'label' =>
array (
'text' => '',
'position' => '',
),
'sublabel' => '',
'multiple' => '0',
'size' => '',
'class' => '',
'title' => '',
'style' => 'float:left;',
'params' => '',
':data-load-state' => '',
':data-tooltip' => '',
'type' => 'dropdown',
'container_id' => '1',
);
$field["options"] = $options;
echo '<div style="float:right;position:relative;">'.\GCore\Helpers\Html::formLine($field["name"], $field).'</div>';
But I dont know how to modify this code to get filter to latest value (now 2015-09).
someone knows?
thank you