Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define("UsrMyModalPage", ["ModalBox", "UsrMyModalPageResources"], function(ModalBox, resources) {
- return {
- attributes: {
- "TestText": {
- dataValueType: Terrasoft.DataValueType.TEXT,
- type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
- },
- "TestText2": {
- dataValueType: Terrasoft.DataValueType.TEXT,
- type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
- },
- "Date": {
- dataValueType: Terrasoft.DataValueType.DATE_TIME,
- type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
- },
- "UsrBalance": {
- // Тип данных колонки модели представления.
- dataValueType: Terrasoft.DataValueType.FLOAT,
- // Массив конфигурационных объектов, определяющих зависимости колонки [UsrBalance].
- }
- },
- messages: {
- "DataFromModal": {
- mode: Terrasoft.MessageMode.PTP,
- direction: Terrasoft.MessageDirectionType.PUBLISH
- }
- },
- methods: {
- init: function(callback, scope) {
- this.callParent(arguments);
- },
- onRender: function() {
- },
- onCloseButtonClick: function() {
- this.sandbox.publish("DataFromModal", { test: this.get("TestText") }, [this.sandbox.id]);
- this.sandbox.publish("DataFromModal", { test: this.get("TestText2") }, [this.sandbox.id]);
- this.sandbox.publish("DataFromModal", { test: this.get("Date") }, [this.sandbox.id]);
- ModalBox.close();
- }
- },
- diff: [
- {
- "operation": "insert",
- "parentName": "Header",
- "propertyName": "items",
- "name": "UsrBalance",
- "values": {
- "bindTo": "UsrBalance",
- "layout": {"column": 12, "row": 2, "colSpan": 12}
- }
- },
- {
- "operation": "insert",
- "name": "MyContainer",
- "propertyName": "items",
- "values": {
- "itemType": Terrasoft.ViewItemType.CONTAINER,
- "items": []
- }
- },
- {
- "operation": "insert",
- "parentName": "MyContainer",
- "propertyName": "items",
- "name": "MyGridContainer",
- "values": {
- "itemType": Terrasoft.ViewItemType.GRID_LAYOUT,
- "items": []
- }
- },
- {
- "operation": "insert",
- "parentName": "MyGridContainer",
- "propertyName": "items",
- "name": "TestText2",
- "values": {
- "bindTo": "TestText2",
- "caption": "План",
- "layout": {"column": 5, "row": 5, "colSpan": 10}
- }
- },
- {
- "operation": "insert",
- "parentName": "MyGridContainer",
- "propertyName": "items",
- "name": "TestText",
- "values": {
- "bindTo": "TestText",
- "caption": "План2",
- "layout": {"column": 0, "row": 0, "colSpan": 10}
- }
- },
- {
- "operation": "insert",
- "name": "Date",
- "values": {
- "layout": {"colSpan": 15,"rowSpan": 1,"column": 0,"row": 6,},
- "bindTo": "Date",
- "caption": Date(),
- },
- "parentName": "MyGridContainer",
- "propertyName": "items",
- "index": 3
- },
- {
- "operation": "insert",
- "parentName": "MyGridContainer",
- "name": "CloseButton",
- "propertyName": "items",
- "values": {
- "itemType": Terrasoft.ViewItemType.BUTTON,
- "style": Terrasoft.controls.ButtonEnums.style.BLUE,
- "click": {bindTo: "onCloseButtonClick"},
- "markerValue": "CloseButton",
- "caption": "OK",
- "layout": { "column": 0, "row": 1, "colSpan": 3 }
- }
- }
- ]
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement