Commit 95e4130a authored by Chris Hynes's avatar Chris Hynes

Support for auto wireup via data-role="multiselect" attribute

parent 68891ec0
......@@ -249,6 +249,10 @@ Additional Styling can be done using the multiselect class:
float: right;
}
## Usage via data attributes
To hook up the control via data attributes, add the `data-role="multiselect"` attribute to your `<select>`. All selects with that attribute will be automatically wired up on jQuery load.
## Knockout JS Support
Thanks to [Devristo](https://github.com/Devristo) this plugin supports [Knockout JS](http://knockoutjs.com/). For further discussion see [the pull requests](https://github.com/davidstutz/bootstrap-multiselect/pull/17).
......
......@@ -397,6 +397,21 @@
<td>
Make the menu drop right instead of dropping left with <code>dropRight</code>.
</td>
</tr>
<tr>
<td>
<select id="example26" multiple="multiple" data-role="multiselect">
<option value="cheese">Cheese</option>
<option value="tomatoes">Tomatoes</option>
<option value="mozarella">Mozzarella</option>
<option value="mushrooms">Mushrooms</option>
<option value="pepperoni">Pepperoni</option>
<option value="onions">Onions</option>
</select>
</td>
<td>
Using the <code>data-role="multiselect"</code> attribute for automatic wireup.
</td>
</tr>
</table>
<div class="page-header">
......
......@@ -376,4 +376,9 @@
}
});
}
$(function()
{
$("select[data-role=multiselect]").multiselect();
});
}(window.jQuery);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment