203
203
Specific options per type
204
204
-------------------------
205
205
206
+ ### fieldset and section
207
+
206
208
*fieldset* and *section* doesn't need a key. You can create generic groups with them.
207
209
They do need a list of ` ` ` items` ` ` to have as children.
208
210
` ` ` javascript
@@ -215,8 +217,10 @@ They do need a list of ```items``` to have as children.
215
217
}
216
218
` ` `
217
219
220
+ ### conditional
221
+
218
222
A *conditional* is exactly the same as a *section*, i.e. a ` ` ` < div> ` ` ` with other form elements in
219
- it, hence they *section* needs an ` ` ` items` ` ` property. They also need a ` ` ` condition` ` ` which is
223
+ it, hence they need an ` ` ` items` ` ` property. They also need a ` ` ` condition` ` ` which is
220
224
a string with an angular expression. If that expression evaluates as thruthy the *conditional*
221
225
will be rendered into the DOM otherwise not. The expression is evaluated in the parent scope of
222
226
the ` ` ` sf- schema` ` ` directive (the same as onClick on buttons). This is useful for hiding/showing
@@ -264,7 +268,7 @@ event handlers and such. The condition need not reference a model value it could
264
268
scope.
265
269
266
270
267
-
271
+ ### select and checkboxes
268
272
269
273
*select* and *checkboxes* can take an object, ` ` ` titleMap` ` ` , where key is the value to be saved on the model
270
274
and the value is the title of the option.
@@ -278,6 +282,8 @@ and the value is the title of the option.
278
282
}
279
283
` ` `
280
284
285
+ ### actions
286
+
281
287
*actions* behaves the same as fieldset, but can only handle buttons as chidren.
282
288
` ` ` javascript
283
289
{
@@ -289,8 +295,13 @@ and the value is the title of the option.
289
295
}
290
296
` ` `
291
297
298
+ ### button
299
+
292
300
*button* can have a ` ` ` onClick` ` ` attribute that either, as in JSON Form, is a function *or* a
293
- string with an angular expression, as with ng-click.
301
+ string with an angular expression, as with ng-click. The expression is evaluated in the parent scope of
302
+ the ` ` ` sf- schema` ` ` directive.
303
+
304
+ ` ` ` javascript
294
305
[
295
306
{ type: ' button' , title: ' Ok' , onClick : function (){ ... } }
296
307
{ type: ' button' , title: ' Cancel' , onClick: " cancel()" }
0 commit comments