HTML Helper
Helper |
Description |
classIf |
Set the CSS classes if the condition is true. |
selectedIf |
Sets the selected attribute if the condition is true. |
checkedIf |
Sets the checked attribute if the condition is true. |
options |
Generates a select drop-down option list. |
classIf
Set the CSS classes if the condition is true.
Parameters:
// results in: foo
hbs.compile("{{classIf expression 'foo'}}")({"expression":true});
selectedIf
Sets the selected attribute if the condition is true.
Parameters:
expression: boolean
Condition to be checked.
// results in: selected
hbs.compile("{{selectedIf expression}}")({"expression":true});
checkedIf
Sets the checked attribute if the condition is true.
Parameters:
expression: boolean
Condition to be checked.
// results in: checked
hbs.compile("{{checkedIf expression}}")({"expression":true});
options
Generates a select drop-down option list.
Parameters:
// results in:
// <option value="1">foo</option>
// <option value="2" selected>bar</option>
hbs.compile("{{{options data selected='2'}}}")({"data":[{"value":1,"text":"foo"},{"value":2,"text":"bar"}]});
// results in:
// <option value="392" selected>JAPAN</option>
// <option value="840">UNITED STATES</option>
hbs.compile("{{{options data selected='392' value='code' text='name'}}}")({"data":[{"code":392,"name":"JAPAN"},{"code":840,"name":"UNITED STATES"}]});