A multiselect component for react (with bootstrap). This is a react port of: https://github.com/davidstutz/bootstrap-multiselect
npm install react-bootstrap-multiselect


A multiselect component for react (with bootstrap). This is a react wrapper
around an existing jQuery/bootstrap library (it is not a pure react port):
1) Install the module with: npm install --save react-bootstrap-multiselect
2) Create your module (you need to use something like browserify to build)
``javascript`
var React = require('react');
var Multiselect = require('react-bootstrap-multiselect');
var someReactComponent = React.createClass({
render: function () {
return (
);
}
});
3) Include the multi-select CSS in your project somewhere. The CSS file is here:
bootstrap-multiselect.css
(don't hotlink- download and host your own copy)
`html`
- React 13 users should use react-bootstrap-multiselect v0.6.0
- React 14 users should use react-bootstrap-multiselect v1.0.2
- React 15 users should use react-bootstrap-multiselect v2.x.x
In case this.state.myData changes from outside of multiselect component, values and checkbox state will not update automatically. If you want to sync state, you have to call .syncData() on multiselect like in example below.
`javascript
var React = require('react');
var Multiselect = require('react-bootstrap-multiselect');
var someReactComponent = React.createClass({
getInitialState: function(){
var that = this;
$("element").on("event", function(){
$.get("new-data-from-url", function(newData){
that.setState(newData);
// to sync manually do
that.refs.myRef.syncData();
});
});
return {
myData : [{value:'One',selected:true},{value:'Two'}]
};
},
render: function () {
return (
);
}
});
``
For in depth documentation, see the original
bootstrap-multiselect project page.
- Source Code
- Changelog
- Live Demo
- Original Plugin
- react-select
- react-selectize
Copyright (c) 2014 skratchdot
Uses the original bootstrap-multiselect license.