All files / web/bundles/pimdatagrid/js/datagrid/cell select-cell.js

70% Statements 7/10
25% Branches 1/4
75% Functions 3/4
70% Lines 7/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38  6x                     6x         46x 46x 46x 92x     46x                            
/* global define */
define(['underscore', 'backgrid'],
function(_, Backgrid) {
    'use strict';
 
    /**
     * Select column cell. Added missing behaviour.
     *
     * @export  oro/datagrid/select-cell
     * @class   oro.datagrid.SelectCell
     * @extends Backgrid.SelectCell
     */
    return Backgrid.SelectCell.extend({
        /**
         * @inheritDoc
         */
        initialize: function (options) {
            Eif (this.choices) {
                this.optionValues = [];
                _.each(this.choices, function(value, key) {
                    this.optionValues.push([value, key]);
                }, this);
            }
            Backgrid.SelectCell.prototype.initialize.apply(this, arguments);
        },
 
        /**
         * @inheritDoc
         */
        enterEditMode: function (e) {
            if (this.column.get("editable")) {
                e.stopPropagation();
            }
            return Backgrid.StringCell.prototype.enterEditMode.apply(this, arguments);
        }
    });
});