octobercms/october · error · Error

The row attribute is not set for the row #

Error message

The row attribute {keyColumn} is not set for the row #{i}

What it means

While building the data table DOM, row #i is missing the key column attribute (options.keyColumn), so the widget cannot identify the row's record key. Usually the record data passed to the client does not contain the key column field at all.

Solutions

  1. Ensure every record returned to the table includes the key column field (default 'id')
  2. Verify options.keyColumn matches the actual key field name in the data
  3. Make sure server-side handlers return records keyed with the configured key column
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/widgets/table/assets/js/table.js:370 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/83006ac8356d96b8. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/widgets/table/assets/js/table.js:370

        for (var i = 0, len = headerCells.length; i < len; i++) {
            if (dataCells[i]) {
                dataCells[i].setAttribute('style', headerCells[i].getAttribute('style'));
            }
        }
    }

    Table.prototype.buildDataTable = function(records, totalCount) {
        var dataTable = document.createElement('table'),
            tbody = document.createElement('tbody'),
            keyColumn = this.options.keyColumn

        dataTable.setAttribute('class', 'data')

        for (var i = 0, len = records.length; i < len; i++) {
            var row = document.createElement('tr')

            if (records[i][keyColumn] === undefined)
                throw new Error('The row attribute '+keyColumn+' is not set for the row #'+i);

            row.setAttribute('data-row', records[i][keyColumn])
            for (var j = 0, colsLen = this.options.columns.length; j < colsLen; j++) {
                var cell = document.createElement('td'),
                    dataContainer = document.createElement('input'),
                    cellContentContainer = document.createElement('div'),
                    column = this.options.columns[j],
                    columnName = column.key,
                    cellProcessor = this.getCellProcessor(columnName)

                cell.setAttribute('data-column', columnName)
                cell.setAttribute('data-column-type', column.type)

                dataContainer.setAttribute('type', 'hidden')
                dataContainer.setAttribute('data-container', 'data-container')
                dataContainer.value = this.formatDataContainerValue(records[i][columnName])

                cellContentContainer.setAttribute('class', 'content-container')

View on GitHub (pinned to b608633a7e)