How can I hide a SelectBox in properties panel?

Hi, I want to hide a simple SelectBox in my Properties Panel. I have finally achieved this using a css selector by [attribute] i.e. div[data-entry=‘select-box’].

But I wonder why I can’t do the same using properties such as ‘cssClasses’ or ‘hidden’. I have tried but have not succeeded.

This is the selectBox properties in my code:

entryFactory.selectBox(translate,{
            id: 'select-box',
            cssClasses: 'hide-class',
            modelProperty: 'select-box',
            hidden: true
}

Thanks.

Hi @xfuentes, welcome to the forum!

According to the SelectEntryFactory the hidden prop needs to be a function.

entryFactory.selectBox(translate,{
  id: 'select-box',
  cssClasses: 'hide-class',
  modelProperty: 'select-box',
  hidden: function() { return true; }
}

Also, it seems like cssClasses is not supported for this component. Probably it was not added yet.

Please note that you’re referring to the old properties panel framework here. We have just released an alpha version of the new framework, that uses different entry components.

1 Like