Remove empty option in Reference Selector and how to sort the data in Reference Selector

0
1) Is that had any idea to remove the empty option in Reference Selector.   2) how to sort the data in Reference Selector
asked
4 answers
1

Hi Wei Jie Sow,

 

You can add an additional attribute to your master data entity for months call it SrNo. Then assign serial numbers for each month, like this:

January - 1

February - 2

March  -  3

...

December -12

In the Reference Selector, go to the Selectable objects tab, and under Sort order, select the new SrNo attribute and choose Ascending. This will ensure that your months are displayed in order.

 

Hope this helps!

 

Thanks

answered
1

Hi Wei Jie Sow

 

You can remove empty option by this code

class-to-put-on-input option:first-child {

    display: none;

} you can find in this documentation for styling https://docs.mendix.com/howto/front-end/customize-styling-new/

and for sort you using Selectable Objects either using X path or Microflow by this you can write your custom logic. I hope this will help.

answered
0

Hi Wei,

 

1. for removing empty option you need to write the JS code.

2.  for Sorting the options you do it selectable window of reference selector. 

image.png

answered
0

Hi Syed Nusrath mehdi, I put the code in the custom-variable.js but it appear errorimage.png

answered