Using conditions in Styles

Hi all,

I want to create a user management. Easy one . Just a table with rows. I want to achieve this:
I do not use text fields to display data in the table. I’m using INPUT-Element. Default-Text: Database value. So I can do a cool inline edit. That works fine.

I created a toggle switch, that the user can activate “inline edit”. if this is enabled, the input fields behaviour should be “normal” - user can edit the field inline.
BUT: if the switch is “off”, I want to set, that the input fields are “disabled” and the user cant do inline edit changes. I tried to use custom state, also store the users choice (inline edit on/off switch state) in the database users object, but I can not use a condition (in the STYLE tab) to change the behaviour, so that the INPUT field isnt editable by the user. I cant access to custom states OR current user’s db-value in the STYLE tab.

I hope I explained it okay :wink:

best
juxpi

I used the style to change the behaviour of my input field globally. I use different kinds of conditionals.

You can do this in the conditional tab by using the disabled feature of the input. See demo below:
chrome_FVOaRSbNyT

And here is the conditional tab of the input:

I’d maybe consider different text or background color when in view mode.

@hergin, ay reason you have both conditionals instead of just when it’s checked; otherwise resorting to default?

Good point. No reason to be honest. One should probably be fine. Maybe I didnt trust Bubble to go back :slight_smile:

:wink: hear hear.

I like to keep it simple as them it gets confusing which is default and when making a change to default have to do so 2x

This topic was automatically closed after 70 days. New replies are no longer allowed.