Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-form-dynamic-select

# Conflicts:
#	angular-schema-form-dynamic-select.js
#	angular-schema-form-dynamic-select.min.js
  • Loading branch information
nicklasb committed Mar 23, 2016
2 parents 2cf033b + e606797 commit 6486b5e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,19 @@ Example(the same as in the example file):
]

```
## Positioning the angularStrap select.
The placement option can be used to position a [strapselect](http://mgcrea.github.io/angular-strap/#/selects). Possible values for placement are top, bottom, left, right, auto or any combination (e.g. bottom-right).
Further details can be found in the [angularStrap select documentation](http://mgcrea.github.io/angular-strap/#/selects-usage).

Example (the same as in the example file):
```js
"key": "select_placement",
"placeholder": "Please select from the right.",
"options": {
"placement": "right"
}

```
### And then a submit button.
Not needed, of course, but is commonly used.
```js
Expand Down
13 changes: 13 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ testApp.controller("appController", ["$scope", "$http", function ($scope, $http)
items: {type: "string"},
description: "If you select more than two items here, it will only show the first two and "
},
select_placement: {
title: "Strap select with position set to right",
type: "string",
enum: ["value1", "value2", "value3"],
description: "Position of the select set using the placement option."
},
"priorities": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -329,6 +335,13 @@ testApp.controller("appController", ["$scope", "$http", function ($scope, $http)
{"value": "value4", "name": "text4"}
]
},
{
"key": "select_placement",
"placeholder": "Please select from the right.",
"options": {
"placement": "right"
}
},
{
"key": "priorities.priority",
"title": "Array inside an object, defaults ASF select only",
Expand Down
4 changes: 3 additions & 1 deletion src/strapmultiselect.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
<button type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$"
data-placeholder="{{form.placeholder || form.schema.placeholder || ('placeholders.select')}}"
data-html="1"
data-multiple="1" data-multiple="1" data-max-length="{{form.options.inlineMaxLength}}"
data-multiple="1"
data-placement="{{form.options.placement || 'bottom-left'}}"
data-max-length="{{form.options.inlineMaxLength}}"
data-max-length-html="{{form.options.inlineMaxLengthHtml}}"
bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:&quot;$$value$$&quot;"
bs-select>
Expand Down
2 changes: 2 additions & 0 deletions src/strapselect.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$"
data-placeholder="{{form.placeholder || form.schema.placeholder || ('placeholders.select')}}"
data-html="1" data-multiple="1" data-max-length="{{form.options.inlineMaxLength}}"
data-placement="{{form.options.placement || 'bottom-left'}}"
data-max-length-html="{{form.options.inlineMaxLengthHtml}}"
bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:&quot;$$value$$&quot;"
bs-select>
Expand All @@ -15,6 +16,7 @@
type="button" class="btn btn-default" sf-changed="form" schema-validate="form" ng-model="$$value$$"
data-placeholder="{{form.placeholder || form.schema.placeholder || ('placeholders.select')}}"
data-html="1"
data-placement="{{form.options.placement || 'bottom-left'}}"
bs-options="item.value as item.name for item in form.titleMap | selectFilter:this:$$value$$:&quot;$$value$$&quot;"
bs-select>
</button>
Expand Down

0 comments on commit 6486b5e

Please sign in to comment.