Редактируемый грид для ProjectFinanceDetailV2
define("ProjectFinanceDetailV2", ["ProjectFinanceDetailV2Resources", "terrasoft", "ProjectUtilities", "ConfigurationGrid", "ConfigurationGridGenerator",
"ConfigurationGridUtilities"],
function(resources, Terrasoft) {
return {
entitySchemaName: "Project",
attributes: {
"IsEditable": {
dataValueType: Terrasoft.DataValueType.BOOLEAN,
type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
value: true
}
},
mixins: {
ConfigurationGridUtilities: "Terrasoft.ConfigurationGridUtilities"
},
methods: {},
diff: /**SCHEMA_DIFF*/[
{
"operation": "merge",
"name": "DataGrid",
"values": {
"className": "Terrasoft.ConfigurationGrid",
"generator": "ConfigurationGridGenerator.generatePartial",
"generateControlsConfig": {"bindTo": "generateActiveRowControlsConfig"},
"changeRow": {"bindTo": "changeRow"},
"unSelectRow": {"bindTo": "unSelectRow"},
"onGridClick": {"bindTo": "onGridClick"},
"activeRowActions": [
{
"className": "Terrasoft.Button",
"style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
"tag": "save",
"markerValue": "save",
"imageConfig": {"bindTo": "Resources.Images.SaveIcon"}
},
{
"className": "Terrasoft.Button",
"style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
"tag": "cancel",
"markerValue": "cancel",
"imageConfig": {"bindTo": "Resources.Images.CancelIcon"}
},
{
"className": "Terrasoft.Button",
"style": this.Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
"tag": "remove",
"markerValue": "remove",
"imageConfig": {"bindTo": "Resources.Images.RemoveIcon"}
}
],
"initActiveRowKeyMap": {"bindTo": "initActiveRowKeyMap"},
"activeRowAction": {"bindTo": "onActiveRowAction"},
"multiSelect": {"bindTo": "MultiSelect"}
}
}
]/**SCHEMA_DIFF*/
};
}
);
Результат:
VM10270:3 Uncaught TypeError: c is not a constructor
at eval (eval at getInstantiator (all-combined.js:6), :3:8)
at Object.instantiate (all-combined.js:6)
at constructor.create (all-combined.js:6)
at constructor.injectedExt.create (core-base.js:731)
at i.createViewModel (:4302/0/configuration/0ddf1b9ff3da28d08badcdad616ed684ru-RU/GridUtilitiesV2.js:296)
at i.fire (all-combined.js:6)
at i.continueFireEvent (all-combined.js:6)
at i.fireEventArgs (all-combined.js:6)
at i.fireEvent (all-combined.js:6)
at i.createViewModelByQueryResult (all-combined.js:7)
(anonymous) @ VM10270:3
instantiate @ all-combined.js:6
(anonymous) @ all-combined.js:6
injectedExt.create @ core-base.js:731
createViewModel @ :4302/0/configuration/0ddf1b9ff3da28d08badcdad616ed684ru-RU/GridUtilitiesV2.js:296
fire @ all-combined.js:6
continueFireEvent @ all-combined.js:6
fireEventArgs @ all-combined.js:6
fireEvent @ all-combined.js:6
createViewModelByQueryResult @ all-combined.js:7
getViewModelByQueryResult @ all-combined.js:7
(anonymous) @ all-combined.js:7
Terrasoft.each @ all-combined.js:7
_getResponseEntityCollection @ all-combined.js:7
parseResponse @ all-combined.js:7
responseHandler @ all-combined.js:7
callParent @ all-combined.js:6
responseHandler @ all-combined.js:7
(anonymous) @ all-combined.js:7
callback @ all-combined.js:7
e.callback @ all-combined.js:7
callback @ all-combined.js:6
onComplete @ all-combined.js:6
onStateChange @ all-combined.js:6
(anonymous) @ all-combined.js:6
core-base.js:681 user: Supervisor/7f3b869f-34f3-4f20-ab4d-7480a5fdf647
file:
line: 3
column: 8
message: Uncaught TypeError: c is not a constructor
date: Mon Mar 04 2019 09:58:01 GMT+0300 (Москва, стандартное время)
stack: TypeError: c is not a constructor
at eval (eval at getInstantiator (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:6:55905), :3:8)
at Object.instantiate (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:6:55680)
at constructor.create (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:6:19717)
at constructor.injectedExt.create (http://localhost:4302/core/d6858dd912ac41a5416c2d8d281f55ca/Terrasoft/amd/core-base.js:731:31)
at i.createViewModel (http://localhost:4302/0/configuration/0ddf1b9ff3da28d08badcdad616ed684ru-RU/GridUtilitiesV2.js:296:29)
at i.fire (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:6:100085)
at i.continueFireEvent (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:6:115389)
at i.fireEventArgs (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:6:115170)
at i.fireEvent (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:6:114998)
at i.createViewModelByQueryResult (http://localhost:4302/core/cf550cb64e832a8a4ccab00385d042e1/combined/all-combined.js:7:1185161)
Нравится
Есть идеи как сделать данную деталь с редактируемым гридом?
Код написан правильно. Должно всё работать.
Возможно была выбрана не та схема представления детали или неправильно указан родитель
Должно быть: "Схема модели представления детали с реестром", а родитель "BaseGridDetailV2"
Дубов Андрей Владимирович пишет:
Код написан правильно. Должно всё работать.
Возможно была выбрана не та схема представления детали или неправильно указан родительДолжно быть: "Схема модели представления детали с реестром", а родитель "BaseGridDetailV2"
Все верно, родитель BaseGridDetailV2.
Моя схема - замещающий клиентский модуль модуля ProjectFinanceDetailV2, который в свою очередь, унаследован от BaseGridDetailV2
Вопрос с «c is not a constructor» в getInstantiator обсуждают тут, пытаются переделать стандартный механизм extjs для вывода более информативного ответа.