all files / grid/renderer/ batch-edit-renderer.js

100% Statements 29/29
100% Branches 9/9
100% Functions 5/5
100% Lines 29/29
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 39 40   104×   187×   187× 187× 187× 187× 187×   187× 187×   187× 187×   187× 140×   187×        
define(["require", "exports", "@syncfusion/ej2-base", "../base/string-literals"], function (require, exports, ej2_base_1, literals) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var BatchEditRender = (function () {
        function BatchEditRender(parent) {
            this.parent = parent;
        }
        BatchEditRender.prototype.update = function (elements, args) {
            if (this.parent.isReact && args.columnObject && args.columnObject.template) {
                var parentRow = args.cell.parentElement;
                var newTd = args.cell.cloneNode(true);
                parentRow.insertBefore(newTd, args.cell);
                newTd.focus();
                args.cell.remove();
                args.cell = newTd;
            }
            args.cell.setAttribute('aria-label', args.cell.innerHTML + this.parent.localeObj.getConstant('ColumnHeader') + args.columnObject.field);
            args.cell.innerHTML = '';
            args.cell.appendChild(this.getEditElement(elements, args));
            args.cell.classList.add('e-editedbatchcell');
            ej2_base_1.classList(args.row, [literals.editedRow, 'e-batchrow'], []);
        };
        BatchEditRender.prototype.getEditElement = function (elements, args) {
            var gObj = this.parent;
            var form = this.parent
                .createElement('form', { id: gObj.element.id + 'EditForm', className: 'e-gridform' });
            form.appendChild(elements[args.columnObject.uid]);
            if (args.columnObject.editType === 'booleanedit') {
                args.cell.classList.add('e-boolcell');
            }
            if (!args.columnObject.editType) {
                args.cell.classList.add('e-inputbox');
            }
            return form;
        };
        return BatchEditRender;
    }());
    exports.BatchEditRender = BatchEditRender;
});