Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
472
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.49 KB | None | 0 0
  1.  define("UsrMyModalPage",  ["ModalBox", "UsrMyModalPageResources"], function(ModalBox, resources) {
  2.     return {
  3.        
  4.         attributes: {
  5.             "TestText": {
  6.                 dataValueType: Terrasoft.DataValueType.TEXT,
  7.                 type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
  8.             },
  9.             "TestText2": {
  10.                 dataValueType: Terrasoft.DataValueType.TEXT,
  11.                 type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
  12.             },
  13.             "Date": {
  14.                 dataValueType: Terrasoft.DataValueType.DATE_TIME,
  15.                 type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN
  16.             },
  17.             "UsrBalance": {
  18.                 // Тип данных колонки модели представления.
  19.                 dataValueType: Terrasoft.DataValueType.FLOAT,
  20.                 // Массив конфигурационных объектов, определяющих зависимости колонки [UsrBalance].
  21.             }
  22.         },
  23.         messages: {
  24.             "DataFromModal": {
  25.                 mode: Terrasoft.MessageMode.PTP,
  26.                 direction: Terrasoft.MessageDirectionType.PUBLISH
  27.             }
  28.         },
  29.         methods: {
  30.             init: function(callback, scope) {
  31.                 this.callParent(arguments);
  32.             },
  33.             onRender: function() {
  34.             },
  35.             onCloseButtonClick: function() {
  36.                 this.sandbox.publish("DataFromModal", { test: this.get("TestText") }, [this.sandbox.id]);
  37.                 this.sandbox.publish("DataFromModal", { test: this.get("TestText2") }, [this.sandbox.id]);
  38.                 this.sandbox.publish("DataFromModal", { test: this.get("Date") }, [this.sandbox.id]);
  39.                 ModalBox.close();
  40.             }
  41.            
  42.         },
  43.         diff: [
  44.            
  45.              {
  46.                 "operation": "insert",
  47.                 "parentName": "Header",
  48.                 "propertyName": "items",
  49.                 "name": "UsrBalance",
  50.                 "values": {
  51.                     "bindTo": "UsrBalance",
  52.                     "layout": {"column": 12, "row": 2, "colSpan": 12}
  53.                 }
  54.             },
  55.             {
  56.                 "operation": "insert",
  57.                 "name": "MyContainer",
  58.                 "propertyName": "items",
  59.                 "values": {
  60.                     "itemType": Terrasoft.ViewItemType.CONTAINER,
  61.                     "items": []
  62.                 }
  63.             },
  64.             {
  65.                 "operation": "insert",
  66.                 "parentName": "MyContainer",
  67.                 "propertyName": "items",
  68.                 "name": "MyGridContainer",
  69.                 "values": {
  70.                     "itemType": Terrasoft.ViewItemType.GRID_LAYOUT,
  71.                     "items": []
  72.                 }
  73.             },
  74.             {
  75.                 "operation": "insert",
  76.                 "parentName": "MyGridContainer",
  77.                 "propertyName": "items",
  78.                 "name": "TestText2",
  79.                 "values": {
  80.                     "bindTo": "TestText2",
  81.                     "caption": "План",
  82.                     "layout": {"column": 5, "row": 5, "colSpan": 10}
  83.                 }
  84.             },
  85.                 {
  86.                 "operation": "insert",
  87.                 "parentName": "MyGridContainer",
  88.                 "propertyName": "items",
  89.                 "name": "TestText",
  90.                 "values": {
  91.                     "bindTo": "TestText",
  92.                     "caption": "План2",
  93.                     "layout": {"column": 0, "row": 0, "colSpan": 10}
  94.                 }
  95.             },
  96.                 {
  97.                 "operation": "insert",
  98.                 "name": "Date",
  99.                 "values": {
  100.                     "layout": {"colSpan": 15,"rowSpan": 1,"column": 0,"row": 6,},
  101.                     "bindTo": "Date",
  102.                     "caption": Date(),
  103.                 },
  104.                 "parentName": "MyGridContainer",
  105.                 "propertyName": "items",
  106.                 "index": 3
  107.             },
  108.             {
  109.                 "operation": "insert",
  110.                 "parentName": "MyGridContainer",
  111.                 "name": "CloseButton",
  112.                 "propertyName": "items",
  113.                 "values": {
  114.                     "itemType": Terrasoft.ViewItemType.BUTTON,
  115.                     "style": Terrasoft.controls.ButtonEnums.style.BLUE,
  116.                     "click": {bindTo: "onCloseButtonClick"},
  117.                     "markerValue": "CloseButton",
  118.                     "caption": "OK",
  119.                     "layout": { "column": 0, "row": 1, "colSpan": 3 }
  120.                 }
  121.             }
  122.         ]
  123.     };
  124. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement