src/aria/widgets/controllers/MultiSelectController.js
function (selectedValues) {
            var toDisplay = this._fieldDisplay, options = this._dataModel.listContent;
            var backUp = (this._fieldDisplay == 'value') ? 'label' : 'value';

            var display = [], option;
            for (var i = 0, l = selectedValues.length; i < l; i++) {
                option = selectedValues[i];
                for (var j = 0, l2 = options.length; j < l2; j++) {
                    if (options[j].value == option) {
                        display.push(options[j][toDisplay] ? options[j][toDisplay] : options[j][backUp]);
                    }
                }

            }
            return display.join(this._separator);
        }
function (selectedValues) {
            var toDisplay = this._fieldDisplay, options = this._dataModel.listContent;
            var backUp = (this._fieldDisplay == 'value') ? 'label' : 'value';

            var display = [], option;
            for (var i = 0, l = selectedValues.length; i < l; i++) {
                option = selectedValues[i];
                for (var j = 0, l2 = options.length; j < l2; j++) {
                    if (options[j].value == option) {
                        display.push(options[j][toDisplay] ? options[j][toDisplay] : options[j][backUp]);
                    }
                }

            }
            return display.join(this._separator);
        }
function ( selectedValues ) { var toDisplay = this . _fieldDisplay , options = this . _dataModel . listContent ; var backUp = ( this . _fieldDisplay == 'value' ) ? 'label' : 'value' ; var display = [ ] , option ; for ( var i = 0 , l = selectedValues . length ; i < l ; i ++ ) { option = selectedValues [ i ] ; for ( var j = 0 , l2 = options . length ; j < l2 ; j ++ ) { if ( options [ j ] . value == option ) { display . push ( options [ j ] [ toDisplay ] ? options [ j ] [ toDisplay ] : options [ j ] [ backUp ] ) ; } } } return display . join ( this . _separator ) ; }
Adds or remove items from the display value. If I am adding an item I also check that it wasn't already added
previously so there will be no duplicate items displayed.
@param {Array} selectedValues
@return {String}
Adds or remove items from the display value . If I am adding an item I also check that it wasn t already added previously so there will be no duplicate items displayed .