Getting (empty) and (none) value in a dropdown search wherever I am having Enums in the mendix

0
Hi Team, when I use the dynamic dropdown and bind the data as enums then it show first value as empty or none I just want to remove the empty value from the dropdown how can I do that, Please provide the suggestion.  
asked
2 answers
0

Unfortunately there is no built-in function to do this. You can, however, use Javascript to remove the empty value.

These posts are not exactly the same as they are about data grid filters, but they provide a similar solution:

How do you hide (empty) in Drop-down Search Fields of Data Grids

"Empty" value always comes in While using it as a Data Grid filter field

Alternatively, you could consider using a different widget if it fits your design (e.g. radio buttons instead of a dropdown).

answered
0

Hi rahul,

 

For the dropdown add the caption as empty and by using the javascript we can hide the empty based on caption value. Find the field name and Add the javascript snippet and use the below code to hide the empty value.

 

$('.mx-name-searchField46').click(function(){
$('.dropdown-menu li:contains((empty))').hide();
});

Hope this is fullfill your requirement.

 

Thanks,

Ragul.

answered