Properties

DOM properties can be set during data binding via data-bind-prop The value passed to data-bind-prop should be in the syntax: property to be set:value to set

Syntax Examples

<!-- simple string values -->
<!-- these are set through jQuery $el.attr() -->
<input data-bind-prop="id:first"></input>
<input data-bind-prop="value:{{ data.item }}"></input>

<!-- boolean / togglable properties -->
<!-- these are set through jQuery $el.prop() -->
<input data-bind-prop="disabled:is({{ data.item }},string)"></input>
<select>
    <option data-bind-prop="selected:is({{ data.item }},string)"><option>
</select>

Multiple Properties

Should you wish to bind more than one property, eg id & value. You should use the number syntax eg data-bind-prop[1|2|3|4|5]

<!-- simple string values -->
<!-- these are set through jQuery $el.attr() -->
<input data-bind-prop1="id:first" data-bind-prop2="value:{{ data.item }}"></input>

results matching ""

    No results matching ""