Grid showing transient field

we need to show field based on condition, what is possible way to do so?
like based on field value i want to change widgets ?

Hi Siddique we are using transient fields!
We use it to show hilite differnt colors.

Try to use a action for onChange value

see we have to show boolean widget if some field say questionNature = 1, and needs to show suggestBox if questionNature = 2, is it possible ?

I don’t know!
I think you shoud try to create a custom field based on the condition. But I never tried!

Good idea! Yes you have to change the code there

:unamused: it is not good idea to change for everything, we need to live with it, we need to have other templates method

1 « J'aime »

Yes ! I think they should accept more attribute to configure fields

Hi @siddique, if the field questionNature is part of the view, you can use js expressions like this:

<field name="some" showIf="questionNature === 1" />
<field name="some" showIf="questionNature === 2" widget="..." />

All those <show|hide|readonly|required>If attributes can use javascript expressions with the context of the current form values.

bundle of thanks for replying,

this is valid for grid fields too ? for form view it works,

basically i need to switch widget based on questionNature, e.g questionNature == 1 widget = boolean-switch if its 2 widget = SuggestBox

Only supported in form view.