Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
document how we can use the typehead directive with forms
  • Loading branch information
jstrachan committed Oct 1, 2013
1 parent efabf95 commit de1b5dd
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions hawtio-web/src/main/webapp/app/forms/doc/developer.md
Expand Up @@ -39,19 +39,36 @@ e.g.

in the above, the _bar_ property will be hidden from the generated form

## Customizing the labels
## Customizing the labels and tooltips

If you wish to specify a custom label for a property (as by default it will just humanize the id of the property), you can just specify the 'label' property inside the JSON Schema as follows:


properties: {
foo: {
type: "string",
label: "My Foo Thingy"
label: "My Foo Thingy",
tooltip: "My tool tip thingy"
}
}

The **label** and **tooltip** properties are not part of JSON Schema; but an extension like the **tabs** property above.

## Adding custom directive attributes to the control

There are various extra directives you can add to <input> controls like ng-hide and so forth which you can do using a nested **input-attributes** object.

properties: {
foo: {
type: "string",

input-attributes: {
typeahead: "title for title in myQuery($viewValue) | filter:$viewValue"
}
}
}

The **label** is not a JSON Schema property; but an extension like the **tabs** property above.
The above would use the typehead directive to present a pick list of possible values; passing the current text field value so we can more efficiently filter results back from any remote method invocation.

### Ignoring prefix of deeply nested properties

Expand Down

0 comments on commit de1b5dd

Please sign in to comment.