* Create a Cbox Menu. * * @example * // create a cboxMenu under #cbox-container using the default global chart group * var cbox = new CboxMenu('#cbox-container') * .dimension(states) * .group(stateGroup); * // the option text can be se
(parent, chartGroup)
| 35 | * Interaction with the widget will only trigger events and redraws within its group. |
| 36 | */ |
| 37 | constructor (parent, chartGroup) { |
| 38 | super(); |
| 39 | |
| 40 | this._cbox = undefined; |
| 41 | this._promptText = 'Select all'; |
| 42 | this._multiple = false; |
| 43 | this._inputType = 'radio'; |
| 44 | this._promptValue = null; |
| 45 | |
| 46 | this._uniqueId = utils.uniqueId(); |
| 47 | |
| 48 | this.data(group => group.all().filter(this._filterDisplayed)); |
| 49 | |
| 50 | // There is an accessor for this attribute, initialized with default value |
| 51 | this._filterDisplayed = d => this.valueAccessor()(d) > 0; |
| 52 | |
| 53 | this._order = (a, b) => { |
| 54 | if (this.keyAccessor()(a) > this.keyAccessor()(b)) { |
| 55 | return 1; |
| 56 | } |
| 57 | if (this.keyAccessor()(a) < this.keyAccessor()(b)) { |
| 58 | return -1; |
| 59 | } |
| 60 | return 0; |
| 61 | }; |
| 62 | |
| 63 | this.anchor(parent, chartGroup); |
| 64 | } |
| 65 | |
| 66 | _doRender () { |
| 67 | return this._doRedraw(); |
nothing calls this directly
no test coverage detected