deleteRow = function(rowNumber, numOfRows) {
    const obj = this;

    // Global Configuration
    if (obj.options.allowDeleteRow != false) {
        if (obj.options.allowDeletingAllRows == true || obj.options.data.length > 1) {
            // Delete row definitions
            if (rowNumber == undefined) {
                const number = getSelectedRows.call(obj);

                if (number.length === 0) {
                    rowNumber = obj.options.data.length - 1;
                    numOfRows = 1;
                } else {
                    rowNumber = number[0];
                    numOfRows = number.length;
                }
            }

            // Last column
            let lastRow = obj.options.data.length - 1;

            if (rowNumber == undefined || rowNumber > lastRow || rowNumber < 0) {
                rowNumber = lastRow;
            }

            if (! numOfRows) {
                numOfRows = 1;
            }

            // Do not delete more than the number of records
            if (rowNumber + numOfRows >= obj.options.data.length) {
                numOfRows = obj.options.data.length - rowNumber;
            }

            // Onbeforedeleterow
            const onbeforedeleterowRecords = [];
            for (let i = 0; i < numOfRows; i++) {
                onbeforedeleterowRecords.push(i + rowNumber);
            }

            if (dispatch.call(obj, 'onbeforedeleterow', obj, onbeforedeleterowRecords) === false) {
                return false;
            }

            if (parseInt(rowNumber) > -1) {
                // Merged cells
                let mergeExists = false;
                if (obj.options.mergeCells && Object.keys(obj.options.mergeCells).length > 0) {
                    for (let row = rowNumber; row < rowNumber + numOfRows; row++) {
                        if (isRowMerged.call(obj, row, false).length) {
                            mergeExists = true;
                        }
                    }
                }
                if (mergeExists) {
                    if (! confirm(jSuites.translate('This action will destroy any existing merged cells. Are you sure?'))) {
                        return false;
                    } else {
                        obj.destroyMerge();
                    }
                }

                // Clear any search
                if (obj.options.search == true) {
                    if (obj.results && obj.results.length != obj.rows.length) {
                        if (confirm(jSuites.translate('This action will clear your search results. Are you sure?'))) {
                            obj.resetSearch();
                        } else {
                            return false;
                        }
                    }

                    obj.results = null;
                }

                // If delete all rows, and set allowDeletingAllRows false, will stay one row
                if (obj.options.allowDeletingAllRows != true && lastRow + 1 === numOfRows) {
                    numOfRows--;
                    console.error('Jspreadsheet: It is not possible to delete the last row');
                }

                // Remove node
                for (let row = rowNumber; row < rowNumber + numOfRows; row++) {
                    if (Array.prototype.indexOf.call(obj.tbody.children, obj.rows[row].element) >= 0) {
                        obj.rows[row].element.className = '';
                        obj.rows[row].element.parentNode.removeChild(obj.rows[row].element);
                    }
                }

                // Remove data
                const rowRecords = obj.records.splice(rowNumber, numOfRows);
                const rowData = obj.options.data.splice(rowNumber, numOfRows);
                const rowNode = obj.rows.splice(rowNumber, numOfRows);

                for (let j = rowNumber; j < obj.rows.length; j++) {
                    obj.rows[j].y = j;
                }

                for (let j = rowNumber; j < obj.records.length; j++) {
                    for (let i = 0; i < obj.records[j].length; i++) {
                        obj.records[j][i].y = j;
                    }
                }

                // Respect pagination
                if (obj.options.pagination > 0 && obj.tbody.children.length != obj.options.pagination) {
                    obj.page(obj.pageNumber);
                }

                // Remove selection
                conditionalSelectionUpdate.call(obj, 1, rowNumber, (rowNumber + numOfRows) - 1);

                // Keep history
                setHistory.call(obj, {
                    action: 'deleteRow',
                    rowNumber: rowNumber,
                    numOfRows: numOfRows,
                    insertBefore: 1,
                    rowRecords: rowRecords,
                    rowData: rowData,
                    rowNode: rowNode
                });

                // Remove table references
                updateTableReferences.call(obj);

                // Events
                dispatch.call(obj, 'ondeleterow', obj, onbeforedeleterowRecords);
            }
        } else {
            console.error('Jspreadsheet: It is not possible to delete the last row');
        }
    }
}
Delete a row by number

@param integer rowNumber - row number to be excluded
@param integer numOfRows - number of lines
@return void