Имеется иерархическая деталь с редактируемым реестром. В ней возникает проблема при сохранении дробного числа. Появляется ошибка Cannot read property 'getAttribute' of null, которая возникает в результате того, что метод GetDomRow возвращает undefined. После этого я не могу больше сохранять дробные числа в реестре и приходится перезагружать страницу. Первое сохранение проходит удачно, хоть и успевает появиться ошибка. В результате чего возникает такая проблема? ниже представлен код детали
define("IDSBRefrigeratorInTMADetail",
["ConfigurationGrid", "ConfigurationGridGenerator", "ConfigurationGridUtilities", "ServiceHelper"],
function (ConfigurationGrid, ConfigurationGridGenerator, ConfigurationGridUtilities, ServiceHelper) {
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",
"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.ParentColumnIsEditable;
}
else {
isEditableColumn = this.ColumnIsEditable;
}
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);
},
ParentColumnIsEditable: function (columnName) {
return (columnName === "IDSBPlacementPrice" || columnName === "IDSBNumberOfDoors" || columnName === "IDSBProlongation");
},
ColumnIsEditable: function (columnName) {
return (columnName === "IDSBRBBottlePlan" || columnName === "IDSBRBBottleCurrent"
|| columnName === "IDSBBRBottlePlan" || columnName === "IDSBBRBottleCurrent");
},
init: function () {
this.callParent(arguments);
this.set("IsPageable", false);
this.set("RowCount", 28000);
this.sandbox.subscribe("ReloadRefrigeratorsInTMAGrid", this.onReloadRefrigeratorsInTMAGrid, this);
},
onReloadRefrigeratorsInTMAGrid: function (args) {
var id = this.get("MasterRecordId");
debugger;
if (id === args) {
this.reloadGridData();
}
},
addGridDataColumns: function (esq) {
this.callParent(arguments);
if (!esq.columns.contains("IDSBParent")) {
esq.addColumn("IDSBParent");
}
},
getGridDataColumns: function () {
var gridDataColumns = this.callParent(arguments);
if (!gridDataColumns.IDSBParent) {
gridDataColumns.IDSBParent = {
path: "IDSBParent"
};
}
return gridDataColumns;
},
addToolsButtonMenuItems: function (toolsButtonMenu) {
this.addGridOperationsMenuItems(toolsButtonMenu);
if (this.useDetailWizard) {
this.addDetailWizardMenuItems(toolsButtonMenu);
}
},
prepareResponseCollection: function (collection) {
collection.each(function (item) {
var parent = item.get("IDSBParent");
var parentId = parent && parent.value;
if (parentId) {
item.set("IDSBParentId", parentId);
}
Terrasoft.each(item.columns, function (column) {
this.addColumnLink(item, column);
this.applyColumnDefaults(column);
}, this);
}, this);
}
}
};
});