JSFiddle - React, Tailwind, and code Playground

by Norlihazmey Ghazali

JavaScript

var focusedGrid = null;
function oboutGrid () {
    
}
function Obout () {
    
}

oboutGrid.prototype.convertToExcel = function (columnTypes, excelDataHiddenID, excelDeletedIds) {
    this.ExcelColumnTypes = columnTypes;
    this.ExcelDataContainer = document.getElementById(excelDataHiddenID);
    this.ExcelDeletedIdsContainer = document.getElementById(excelDeletedIds);

    this.ExcelDataContainer.value = '';
    this.ExcelDeletedIdsContainer.value = '';

    this._lastEditedField = null;
    this._lastEditedFieldEditor = null;
    this._keyNavigationIsEnabled = false;
    this._lastEditedFieldEditorValue = null;
}


oboutGrid.prototype.addNewRow = function () {
    this.addRecord();

    this.insertTemporaryRecord(false, true);

    var row = this.GridBodyContainer.firstChild.firstChild.childNodes[1].lastChild;
    var firstVisibleColumnIndex = -1;

    var tempThis = this;

    for (var i = 0; i < this.ColumnsCollection.length; i++) {

        if (this.ExcelColumnTypes[i] != 'Actions') {
            var textBox = document.createElement('INPUT');
            textBox.type = 'text';
            textBox.name = 'TextBox1';
            textBox.className = 'excel-textbox';
            textBox.readOnly = true;
            row.cells[i].firstChild.firstChild.appendChild(textBox);
        }

        switch (this.ExcelColumnTypes[i]) {
            case 'TextBox':
                textBox.onfocus = function () { tempThis.editWithTextBox(this); };
                break;

            case 'MultiLineTextBox':
                textBox.onfocus = function () { tempThis.editWithMultiLineTextBox(this); };
                break;

            case 'ComboBox':
                textBox.onfocus = function () { tempThis.editWithComboBox(this); };
                break;

            case 'CheckBox':
                textBox.onfocus = function () { tempThis.editWithCheckBox(this); };
                break;

            case 'Actions':
                var deleteLink =...