Создал иерархическую деталь с редактируемым реестром. Но появилась проблема при количестве дочерних элементов больше 8. Они почему не отображаются, выдается ошибка Cannot read property 'getAttribute' of null. В БД всё верно.
Вот код детали
define("IDSBRefrigeratorInTMADetail",
["ConfigurationGrid", "ConfigurationGridGenerator", "ConfigurationGridUtilities"],
function () {
return {
messages: {
"ReloadRefrigeratorsInTMAGrid": {
"mode": Terrasoft.MessageMode.BROADCAST,
"direction": Terrasoft.MessageDirectionType.SUBSCRIBE
}
},
entitySchemaName: "IDSBRefrigeratorInTMA",
attributes: {
"IsEditable": {
dataValueType: Terrasoft.DataValueType.BOOLEAN,
type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
value: true
}
},
mixins: {
ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
},
details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
diff: /**SCHEMA_DIFF*/[
{
"operation": "merge",
"name": "DataGrid",
"values": {
"hierarchical": true,
"hierarchicalColumnName": "IDSBParent",
"maxColumns": 48,
"maxRowsCount": 10000,
"className": "Terrasoft.ConfigurationGrid",
"generator": "ConfigurationGridGenerator.generatePartial",
"generateControlsConfig": { "bindTo": "generateActiveRowControlsConfig" },
"changeRow": { "bindTo": "changeRow" },
"unSelectRow": { "bindTo": "unSelectRow" },
"onGridClick": { "bindTo": "onGridClick" },
"activeRowAction": { "bindTo": "onActiveRowAction" },
"initActiveRowKeyMap": { "bindTo": "initActiveRowKeyMap" },
"multiSelect": false
}
},
{
"operation": "remove",
"name": "AddRecordButton"
}]/**SCHEMA_DIFF*/,
methods: {
generateActiveRowControlsConfig: function (id, columnsConfig, rowConfig) {
this.columnsConfig = columnsConfig;
var gridData = this.getGridData();
var activeRow = gridData.get(id);
var isEditableColumn;
if (activeRow.values.IDSBParent === "") {
isEditableColumn = this.isEditableParentColumn;
}
else {
isEditableColumn = this.isEditableColumn;
}
var gridLayoutItems = [];
var currentColumnIndex = 0;
Terrasoft.each(columnsConfig, function (columnConfig) {
var cellConfig = this.getActiveRowCellConfig(columnConfig, currentColumnIndex);
cellConfig.enabled = isEditableColumn(cellConfig.name);
if (!cellConfig.hasOwnProperty("isNotFound")) {
gridLayoutItems.push(cellConfig);
}
currentColumnIndex += cellConfig.layout.colSpan;
}, this);
this.applyBusinessRulesForActiveRow(id, gridLayoutItems);
var viewGenerator = Ext.create(this.getRowViewGeneratorClassName());
viewGenerator.viewModelClass = this;
var gridLayoutConfig = viewGenerator.generateGridLayout({
name: this.name,
items: gridLayoutItems
});
rowConfig.push(gridLayoutConfig);
},
isEditableParentColumn: function (columnName) {
return false;
},
isEditableColumn: function (columnName) {
return (columnName === "IDSBBottlePlan");
}/*,
init: function () {
this.callParent(arguments);
this.sandbox.subscribe("ReloadRefrigeratorsInTMAGrid", this.onReloadRefrigeratorsInTMAGrid, this);
},
onReloadRefrigeratorsInTMAGrid: function (args) {
this.reloadGridData();
}*/
}
};
});