You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a dynamic get used for a front-end listing of items.
In the TWEAK tab I'm using a filter type of FunctionVar with a State Key something like this:
$this->state->get('parameters.menu')->get('catalog_new')
equal to a Table Key
a.new
The a.new field is a yes/no radio field.
The catalog_new field was also created as a yes/no radio field,
and added to the component configs so that it can be used as filters on a front-end menu.
(this is generally working)
However, I need to also allow the query to return results where the a.new field is not filtered.
I have checked the Allow Empty field; however, that just 'allows' the empty.
The problem is that the catalog_new (filtering) field doesn't have a way to 'un-set' it.
I've tried various settings on the catalog_new radio with no way to do it directly that I could figure out.
(Including: default: 0; default: -empty-; no default, - but anything other than 1 is always interpreted as 0 = no)
My only solution was to change catalog_new to a radio button with 3 options (yes,no, n/a - with 'n/a' getting a -1 value) and then to manually override (custom code) the code that was generated by JCB and just ignore when the value is -1.
I'm trying not to use custom code replace wherever possible, but I can't seem to find any way to get the TWEAK to work with this workflow.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've got a dynamic get used for a front-end listing of items.
In the TWEAK tab I'm using a filter type of FunctionVar with a State Key something like this:
$this->state->get('parameters.menu')->get('catalog_new')
equal to a Table Key
a.new
The a.new field is a yes/no radio field.
The catalog_new field was also created as a yes/no radio field,
and added to the component configs so that it can be used as filters on a front-end menu.
(this is generally working)
However, I need to also allow the query to return results where the a.new field is not filtered.
I have checked the Allow Empty field; however, that just 'allows' the empty.
The problem is that the catalog_new (filtering) field doesn't have a way to 'un-set' it.
I've tried various settings on the catalog_new radio with no way to do it directly that I could figure out.
(Including: default: 0; default: -empty-; no default, - but anything other than 1 is always interpreted as 0 = no)
My only solution was to change catalog_new to a radio button with 3 options (yes,no, n/a - with 'n/a' getting a -1 value) and then to manually override (custom code) the code that was generated by JCB and just ignore when the value is -1.
I'm trying not to use custom code replace wherever possible, but I can't seem to find any way to get the TWEAK to work with this workflow.
Any ideas??
Beta Was this translation helpful? Give feedback.
All reactions