Skip to content

Commit 07a07da

Browse files
committed
Radio buttons!
In two forms, "radios" for ordinary radio buttons and "radiobuttons" for bootstrap 3 button group goodness!
1 parent 68e4a70 commit 07a07da

File tree

8 files changed

+120
-12
lines changed

8 files changed

+120
-12
lines changed

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ Schema Form currently supports the following form field types:
7171
| select | a select (single value)|
7272
| submit | a submit button |
7373
| button | a button |
74-
74+
| radios | radio buttons |
75+
| radiobuttons | radio buttons with bootstrap buttons |
7576
7677
7778
Default form types
@@ -299,7 +300,7 @@ and the value is the title of the option.
299300
300301
*button* can have a ```onClick``` attribute that either, as in JSON Form, is a function *or* a
301302
string with an angular expression, as with ng-click. The expression is evaluated in the parent scope of
302-
the ```sf-schema``` directive.
303+
the ```sf-schema``` directive.
303304
304305
```javascript
305306
[
@@ -308,3 +309,33 @@ the ```sf-schema``` directive.
308309
[
309310
```
310311
312+
### radios and radiobuttons
313+
Both type *radios* and *radiobuttons* work the same way, they take a titleMap
314+
and renderes ordinary radio buttons or bootstrap 3 buttons inline. It's a
315+
cosmetic choice.
316+
317+
Ex.
318+
```javascript
319+
function FormCtrl($scope) {
320+
$scope.schema = {
321+
type: "object",
322+
properties: {
323+
choice: {
324+
type: "string",
325+
enum: ["one","two"]
326+
}
327+
}
328+
};
329+
330+
$scope.form = [
331+
{
332+
key: "choice",
333+
type: "radiobuttons",
334+
titleMap: {
335+
one: "One",
336+
two: "More..."
337+
}
338+
}
339+
];
340+
}
341+
```

dist/bootstrap-decorator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)