Dropdown in filters: hide empty entries

isiway

Member
Hi,
for some reasons the select in a dropdown list shows an empty entry:

Like:
Please choose
-- EMPTY/ BLANK line---
ABS
Aluminium
Eisen
....

In HTML it looks like this:
<div class="fabrik_ksb_input_mat1">
<select id="bue_relaunch_fabrik_xdb_ks___auswahl_mat1value" name="fabrik___filter[list_28_mod_fabrik_list_821][value][0]" class="inputbox fabrik_filter input-medium " size="1" data-filter-name="bue_relaunch_fabrik_xdb_ks___auswahl_mat1">
<option value="" selected="selected">Please choose</option>
<option value="0">&nbsp;</option>
<option value="1">ABS</option>
<option value="2">Aluminium</option>
<option value="3">Eisen</option>


How can I avoid to display empty entries? Some Advanced Eval in the element?
in which program is the dropdown populated anyway?

Thank you and kind regards,
Carola
 
Which element type is it?
What are your filter settings? (If "Filter data" is set to "Recorded" it will show anything which is in your table)
Do you have "Advanced/Eval options"?
 
Hi Troester,

thanks for the fast reply!
It is extremly comlicated. I just need to now in which programm the dropdown (with multiselect) in rendered, so I can somehow do something like this:

if value.OPTION="" THEN skip it

Greetings, isiway
 
Nope, we don't help people hack on our code, as that makes future support too difficult. I have literally wasted days of my life trying to fix problems which turn out to be because someone modified the code.

So the only way we can help is identifying why you have a blank entry in the first place. So best to answer Troester's question. And yes, it's probably because you have blank data in the table you are building the join from, and you need to find and fix that.

Or you could use the "Eval Options", under the Advanced tab. If you return false from that, the item will be skipped. So something like ...

return !empty($opt->text);

Although I'm not sure if at that point the &nbsp would already have been inserted, so it may need to be ...

return $opt->text !== '&nbsp';

-- hugh
 
Hi Hugh,

I totally understand your comment about "quick and dirty" I just asked that because the problem was never solved since 2014 although you tried...

Your advice with eval options:
So I tried your suggestions and filled in return $opt->text !== '&nbsp'; in "Eval Options", under the Advanced tab.

It it NOT working, the script has NO influence at all.

I think it is because the element plugin type is "databasejoin" and and under data it is "render as" =multiselect.
In case I select "render as" dropdown "&nbsp;" is not shown, but I get no result in the list, which makes sense because the system has to check the table_repeat_xyz.

Any ideas?

Thank you!
 
You never answered Troester's question I asked you to answer:

What are your filter settings? (If "Filter data" is set to "Recorded" it will show anything which is in your table)

-- hugh
 
Hi Hugh,

oh sorry, I overlooked that.

The setting is set to "show all", if set to "recorded", the filter wont show anything but the Text "choose option" and one empty entry (the one which I want to get rid of).

Filter set to "recorded"
<select id="bue_relaunch_fabrik_xdb_ks___auswahl_mat1value" name="fabrik___filter[list_28_mod_fabrik_list_821][value][0]" class="inputbox fabrik_filter input-medium " size="1" data-filter-name="bue_relaunch_fabrik_xdb_ks___auswahl_mat1">
<option value="" selected="selected">Bitte w?hlen</option>
<option value="0">&nbsp;</option>
</select>


Filter set to "show all":
<select id="bue_relaunch_fabrik_xdb_ks___auswahl_mat1value" name="fabrik___filter[list_28_mod_fabrik_list_821][value][0]" class="inputbox fabrik_filter input-medium " size="1" data-filter-name="bue_relaunch_fabrik_xdb_ks___auswahl_mat1">
<option value="" selected="selected">Bitte w?hlen</option>
<option value="0">&nbsp;</option>
<option value="1">ABS</option>
<option value="2">Aluminium</option>
<option value="3">Eisen</option>
...
<option value="18">PP</option>
<option value="19">PS</option>
<option value="20">PVC</option>
<option value="21">Schaum</option>
</select>

It is weird anyway. Setting f.e. in the element Material 1

Tab Details / Please choose the "Show please choose" to NO also has no effect. Setting another text for "Please choose" does work.

Thank you!




 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top