You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: adminforth/documentation/docs/tutorial/03-Customization/13-standardPagesTuning.md
+161Lines changed: 161 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,167 @@ export default {
143
143
144
144
>⚠️ Please note that sticky columns can only be applied to one column per resource.
145
145
146
+
### Conditional display
147
+
You can conditionally display columns in forms and views based on the values of other fields in the current record using the `showIf` property. This enables dynamic layouts that automatically adapt to user input, creating more intuitive and context-aware interfaces.
148
+
149
+
```typescript title="./resources/apartments.ts"
150
+
exportdefault {
151
+
resourceId: 'aparts',
152
+
columns: [
153
+
{
154
+
name: 'apartment_type',
155
+
enum: [
156
+
{ value: 'studio', label: 'Studio' },
157
+
{ value: 'apartment', label: 'Apartment' },
158
+
{ value: 'penthouse', label: 'Penthouse' }
159
+
]
160
+
},
161
+
{
162
+
name: 'number_of_rooms',
163
+
type: AdminForthDataTypes.INTEGER,
164
+
//diff-add
165
+
showIf: { apartment_type: { $not: 'studio' } }
166
+
},
167
+
{
168
+
name: 'has_balcony',
169
+
type: AdminForthDataTypes.BOOLEAN,
170
+
//diff-add
171
+
showIf: { apartment_type: 'penthouse' }
172
+
}
173
+
]
174
+
}
175
+
```
176
+
177
+
#### Logical Operators
178
+
179
+
Use `$and` and `$or` operators to create complex conditional logic:
0 commit comments