Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>creatio-snippetsNew to Visual Studio Code? Get it now.
creatio-snippets

creatio-snippets

ZnZ

|
275 installs
| (0) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

creatio-snippets

def

Стандартный шаблон define

Template
define("SchemaName", [
	"SchemaNameResources"
], function(resources) {
	return {
		entitySchemaName: "EntitySchemaName",
		mixins: {},
		attributes: {},
		details: /**SCHEMA_DETAILS*/ {} /**SCHEMA_DETAILS*/ ,
		messages: {},
		methods: {},
		rules: {},
		businessRules: /**SCHEMA_BUSINESS_RULES*/ {} /**SCHEMA_BUSINESS_RULES*/ ,
		modules: /**SCHEMA_MODULES*/ {} /**SCHEMA_MODULES*/ ,
		diff: /**SCHEMA_DIFF*/ [] /**SCHEMA_DIFF*/
	};
});

defModalBox

Шаблон модального окна

Template
define("SchemaName", [
	"SchemaNameResources",
	"ModalBox",
], function(resources) {
	return {
		mixins: {},
		attributes: {},
		details: {},
		messages: {},
		methods: {
		/**
		 * @inheritdoc BaseModalBoxPage#getModalBoxInitialConfig
		 * @overridden
		 */
		getModalBoxInitialConfig: function() {
			return {
				modalBoxConfig: {
					boxClasses: ["auto-resize-modal-box"]
				}
			};
		},
	},
	rules: {},
	businessRules: /**SCHEMA_BUSINESS_RULES*/ {} /**SCHEMA_BUSINESS_RULES*/ ,
	modules: /**SCHEMA_MODULES*/ {} /**SCHEMA_MODULES*/ ,
	diff: /**SCHEMA_DIFF*/ [
		// {
		// 	"operation": "remove",
		// 	"name": "CloseButton"
		// },

		/*
		.modal-box-buttons-content-wrap {
			margin-top: 15px;
			float: right;

			& .left-margin {
				margin-left: 10px;
			}
		}
		*/

		{
			"operation": "insert",
			"name": "CardButtonsContainer",
			"parentName": "CardContentContainer",
			"propertyName": "items",
			"values": {
				"itemType": Terrasoft.ViewItemType.CONTAINER,
				"wrapClass": ["modal-box-buttons-content-wrap"],
				"items": []
			}
		},

		{
			"operation": "insert",
			"name": "CancelButton",
			"parentName": "CardButtonsContainer",
			"propertyName": "items",
			"values": {
				"itemType": Terrasoft.ViewItemType.BUTTON,
				"caption": { "bindTo": "Resources.Strings.CancelButtonCaption" },
				"click": { "bindTo": "close" },
				"style": Terrasoft.controls.ButtonEnums.style.GREY,
				"classes": { "textClass": "left-margin" }
			}
		}
	] /**SCHEMA_DIFF*/
};

});


defRod

Шаблон детали "Только для чтения"

Template
define("SchemaName", [
	"SchemaNameResources"
], function(resources) {
	return {
		entitySchemaName: "EntitySchemaName",
		mixins: {},
		attributes: {},
		messages: {},
		methods: {

/** * @inheritdoc BaseGridDetailV2#getAddRecordButtonVisible * @overridden */ getAddRecordButtonVisible: function() { return false; },
/** * @inheritdoc BaseGridDetailV2#getAddTypedRecordButtonVisible * @overridden */ getAddTypedRecordButtonVisible: function() { return false; },
/** * @inheritdoc BaseGridDetailV2#addRecordOperationsMenuItems * @overridden */ addRecordOperationsMenuItems: Terrasoft.emptyFn,
/** * @inheritdoc BaseGridDetailV2#editCurrentRecord * @overridden */ editCurrentRecord: Terrasoft.emptyFn // optional. Can be open record edit card }, diff: /**SCHEMA_DIFF*/ [] /**SCHEMA_DIFF*/ }; });

defEd

Шаблон детали c ред. реестром

Template
define("SchemaName", [
	"SchemaNameResources",
	"ConfigurationGrid",
	"ConfigurationGridGenerator",
	"ConfigurationGridUtilities"
], function(resources) {
	return {
		entitySchemaName: "EntitySchemaName",
		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": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "save",
							"markerValue": "save",
							"imageConfig": { "bindTo": "Resources.Images.SaveIcon" }
						},
						{
							"className": "Terrasoft.Button",
							"style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "cancel",
							"markerValue": "cancel",
							"imageConfig": { "bindTo": "Resources.Images.CancelIcon" }
						},
						{
							"className": "Terrasoft.Button",
							"style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "card",
							"markerValue": "card",
							"imageConfig": { "bindTo": "Resources.Images.CardIcon" }
						},
						{
							"className": "Terrasoft.Button",
							"style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "copy",
							"markerValue": "copy",
							"imageConfig": { "bindTo": "Resources.Images.CopyIcon" }
						},
						{
							"className": "Terrasoft.Button",
							"style": 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*/
	};
});

defEd2

Шаблон детали c ред. реестром v2

Template
define("SchemaName", [
	"SchemaNameResources",
	"ConfigurationGrid",
	"ConfigurationGridGenerator",
	"ConfigurationGridUtilitiesV2"
], function(resources) {
	return {
		entitySchemaName: "EntitySchemaName",
		attributes: {
			"IsEditable": {
				dataValueType: Terrasoft.DataValueType.BOOLEAN,
				type: Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
				value: true
			}
		},
		mixins: {
			ConfigurationGridUtilitiesV2: "Terrasoft.ConfigurationGridUtilitiesV2"
		},
		methods: {
			onActiveRowAction: function(buttonTag, primaryColumnValue) {
				this.mixins.ConfigurationGridUtilitiesV2.onActiveRowAction.call(this, buttonTag, primaryColumnValue);
			}
		},
		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": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "save",
							"markerValue": "save",
							"imageConfig": {"bindTo": "Resources.Images.SaveIcon"}
						},
						{
							"className": "Terrasoft.Button",
							"style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "cancel",
							"markerValue": "cancel",
							"imageConfig": {"bindTo": "Resources.Images.CancelIcon"}
						},
						{
							"className": "Terrasoft.Button",
							"style": Terrasoft.controls.ButtonEnums.style.TRANSPARENT,
							"tag": "card",
							"markerValue": "card",
							"imageConfig": {"bindTo": "Resources.Images.CardIcon"}
						},
						{
							"className": "Terrasoft.Button",
							"style": 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*/
	};
});

defExt

Шаблон Ext класса

Template
define("SchemaName", [
	"SchemaNameResources"
], function(resources) {
	Ext.define("Terrasoft.configuration.SchemaName", {
		alternateClassName: "Terrasoft.SchemaName"
	});

return Ext.create("Terrasoft.SchemaName"); });

defExtOvrd

Шаблон замещения Ext класса

Template
define("SchemaName", [
	"SchemaNameResources",
	"OverrideSchemaName"
], function(resources) {
	Ext.define("Terrasoft.configuration.SchemaName", {
		override: "Terrasoft.OverrideSchemaName"
	});
});

defExtConst

Шаблон Ext констант

Template
define("SchemaName", [
	"SchemaNameResources"
], function(resources) {
	Ext.define("Terrasoft.configuration.SchemaName", {
		alternateClassName: "Terrasoft.SchemaName",
		singleton: true,
	/** @constant Entity */
	Entity: {
		
		/** @constant Record */
		Record: ""
	}
});

return Ext.create("Terrasoft.SchemaName");

});


defExtMixin

Шаблон Ext миксина

Template
define("SchemaName", [
	"SchemaNameResources"
], function(resources) {
	Ext.define("Terrasoft.configuration.mixins.SchemaName", {
		alternateClassName: "Terrasoft.SchemaName",
	});

return Ext.create("Terrasoft.SchemaName"); });

attrVBoolean

Виртуальный булевый атрибут

Template
"AttributeName": {
	"dataValueType": Terrasoft.DataValueType.BOOLEAN,
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"value": false
},

attrVLookup

Виртуальный справочный атрибут

Template
"AttributeName": {
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"dataValueType": Terrasoft.DataValueType.LOOKUP,
	"referenceSchemaName": "Contact",
	"isLookup": true
},

attrVCollection

Виртуальный атрибут коллекции

Template
"AttributeName": {
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"dataValueType": Terrasoft.DataValueType.COLLECTION,
	"value": Ext.create("Terrasoft.Collection"),
	"isCollection": true
},

attrVText

Виртуальный атрибут строки

Template
"AttributeName": {
	"dataValueType": Terrasoft.DataValueType.TEXT,
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"value": Terrasoft.emptyString
},

attrVInteger

Виртуальный атрибут числа

Template
"AttributeName": {
	"dataValueType": Terrasoft.DataValueType.INTEGER,
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"value": 0
},

attrVFloat

Виртуальный атрибут числа

Template
"AttributeName": {
	"dataValueType": Terrasoft.DataValueType.FLOAT,
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"value": 0.0
},

attrVDateTime

Виртуальный атрибут числа

Template
"AttributeName": {
	"dataValueType": Terrasoft.DataValueType.DATE_TIME,
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"value": new Date()
},

attrVDate

Виртуальный атрибут числа

Template
"AttributeName": {
	"dataValueType": Terrasoft.DataValueType.DATE,
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"value": new Date()
},

attrVTime

Виртуальный атрибут числа

Template
"AttributeName": {
	"dataValueType": Terrasoft.DataValueType.TIME,
	"type": Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,
	"value": new Date()
},

msgPublish

Отправка сообщения

Template
"MessageName": {
	"mode": Terrasoft.MessageMode.PTP,
	"direction": Terrasoft.MessageDirectionType.PUBLISH
},

msgSubscribe

Подпись сообщения

Template
"MessageName": {
	"mode": Terrasoft.MessageMode.PTP,
	"direction": Terrasoft.MessageDirectionType.SUBSCRIBE
},

msgBidirectional

Двустороннее сообщение

Template
"MessageName": {
	"mode": Terrasoft.MessageMode.PTP,
	"direction": Terrasoft.MessageDirectionType.BIDIRECTIONAL
},

detail

Обьявление детали

Template
"DetailName": {
	"schemaName": "DetailName",
	"entitySchemaName": "EntitySchemaName",
	"filter": {
		"detailColumn": "EntitySchemaName",
		"masterColumn": "Id"
	}
}

const

Подпись константы

/** @constant  */

prt

Подпись protected

/**
* @protected
*/

inher

Ссылка на родителя

@inheritdoc #

ovrd

Подпись override

/**
* @inheritdoc #
* @override
*/

ovrdm

Подпись override с методом

/**
 * @inheritdoc #
 * @override
 */
: function() {
},

rg

Регион

/** @Region:  */
/** @EndRegion:  */

bind

Биндинг

{ "bindTo": "" }

bindRes

Биндинг ресурса

{ "bindTo": "Resources.Strings." }

callService

Вызов сервиса

Template
/**
 * @protected
 */
callServiceNameServiceMethod: function(callback, scope) {
	this.showBodyMask();
ServiceHelper.callService({
	serviceName: "ServiceName",
	methodName: "ServiceMethod",
	data: this.getServiceNameServiceMethodConfig(),
	callback: function(response, success) {
		this.onServiceNameServiceMethodCallback(response, success, callback, scope);
	},
	scope: this
});

},

/**

  • @protected */ getServiceNameServiceMethodConfig: function() { return { recordId: Terrasoft.GUID_EMPTY }; },

/**

  • @protected */ onServiceNameServiceMethodCallback: function(response, success, callback, scope) { this.hideBodyMask();

    var result = response.ServiceMethodResult; if (!result.success) { this.showInformationDialog(result.errorInfo.message); return; }

    Ext.callback(callback, scope, []); },


callServiceFast

Быстрый вызов сервиса

Template
var ServiceMethodConfig = {
	recordId: Terrasoft.GUID_EMPTY
};

ServiceHelper.callService("ServiceName", "ServiceMethod", function(response) { var result = response.ServiceMethodResult;

if (!result.success){
	Terrasoft.showInformation(result.errorInfo.message);
	return;
}

Ext.callback(callback, scope, [result.result]);

}, ServiceMethodConfig, this);


callback

Вызов callback

Ext.callback(callback, this, []);

esqSelect

Запрос чтения данных

Template
/**
 * @protected
 */
selectQueryNameAsync: function() {
	return new Promise(resolve => this.selectQueryName(resolve, this));
},

/**

  • @protected */ selectQueryName: function(callback, scope) { var esq = this.getSelectQueryNameESQ();

    esq.getEntityCollection(function(result) { this.esqSelectQueryNameCallback(result, callback, scope); }, this); },

/**

  • @protected */ getSelectQueryNameESQ: function() { var esq = Ext.create("Terrasoft.EntitySchemaQuery", { rootSchemaName: "RootSchemaName" });

    this.initSelectQueryNameESQColumns(esq); this.initSelectQueryNameESQFilters(esq);

    return esq; },

/**

  • @protected */ initSelectQueryNameESQColumns: function(esq) { esq.addColumn("Id"); },

/**

  • @protected */ initSelectQueryNameESQFilters: function(esq) { esq.filters.add("", Terrasoft.createColumnFilterWithParameter( Terrasoft.ComparisonType.EQUAL, "", Terrasoft.GUID_EMPTY )); },

/**

  • @protected */ esqSelectQueryNameCallback: function(result, callback, scope) { if (!result.success) { this.showInformationDialog(result.errorInfo.message); return; }

    var entity = result.collection.first(); var collection = result.collection;

    Ext.callback(callback, scope, []); },


esqDelete

Запроос удаления данных

Template
/**
 * @protected
 */
deleteQueryName: function(id, callback, scope) {
	var query = this.getDeleteQueryNameQuery(id);
query.execute(callback, scope);

},

/**

  • @protected */ getDeleteQueryNameQuery: function(id) { var query = Ext.create("Terrasoft.DeleteQuery", { rootSchemaName: "RootSchemaName" });

    this.initDeleteQueryNameQueryFilters(query, id);

    return query; },

/**

  • @protected */ initDeleteQueryNameQueryFilters: function(query, id) { query.filters.add("Id", Terrasoft.createColumnFilterWithParameter( Terrasoft.ComparisonType.EQUAL, "Id", id )); },

esqUpdate

Запрос обновления данных

Template
/**
 * @protected
 */
updateQueryName: function(id, callback, scope) {
	var query = this.getUpdateQueryNameQuery(id);
query.execute(callback, scope);

},

/**

  • @protected */ getUpdateQueryNameQuery: function(id) { var query = Ext.create("Terrasoft.UpdateQuery", { rootSchemaName: "RootSchemaName" });

    this.initUpdateQueryNameQueryParameters(query); this.initUpdateQueryNameQueryFilters(query, id);

    return query; },

/**

  • @protected */ initUpdateQueryNameQueryParameters: function(query) { query.setParameterValue("Name", "...", Terrasoft.DataValueType.TEXT); },

/**

  • @protected */ initUpdateQueryNameQueryFilters: function(query, id) { query.enablePrimaryColumnFilter(id); },

esqInsert

Запрос добавления данных

Template
/**
 * @protected
 */
insertQueryName: function(id, callback, scope) {
	var query = this.getInsertQueryNameQuery(id);
query.execute(callback, scope);

},

/**

  • @protected */ getInsertQueryNameQuery: function(id) { var query = Ext.create("Terrasoft.InsertQuery", { rootSchemaName: "RootSchemaName" });

    this.initInsertQueryNameQueryParameters(query);

    return query; },

/**

  • @protected */ initInsertQueryNameQueryParameters: function(query) { query.setParameterValue("Name", "...", Terrasoft.DataValueType.TEXT); },

esqF

Добавить фильтр

esq.filters.add("uuid", esqFprop);

esqCT

Тип сравнения

Terrasoft.ComparisonType.EQUAL;

esqFProp

Фильтр параметра

Terrasoft.createColumnFilterWithParameter(
	Terrasoft.ComparisonType.EQUAL, "Id", Terrasoft.GUID_EMPTY
)

esqFGroup

Группа фильтра

Template
var filterGroup = Terrasoft.createFilterGroup();

filterGroup.logicalOperation = Terrasoft.LogicalOperatorType.AND;

filterGroup.add("uuid", esqfprop);


esqFBetween

Between фильтр

Terrasoft.createColumnBetweenFilterWithParameters(
	"", , 
)

esqFBetweenDate

Between фильтр даты

Terrasoft.createColumnBetweenFilterWithParameters(
	"CreatedOn", Terrasoft.startOfDay(new Date()), Terrasoft.endOfDay(new Date())
)

esqFIn

In фильтр

Terrasoft.createColumnInFilterWithParameters(
	"Id", array
)

esqFNull

Фильтр на пустоту

Terrasoft.createColumnIsNullFilter("Id")

esqFNotNull

Фильтр на заполненность

Terrasoft.createColumnIsNotNullFilter("Id")

esqFExists

Exists фильтр

Terrasoft.createExistsFilter("[Account:Owner:Id].Id")

esqFNotExists

Not exists фильтр

Terrasoft.createNotExistsFilter("[Account:Owner:Id].Id")

!result

Обработка ошибки запроса

Template
if (!result.success) {
	this.showInformationDialog(result.errorInfo.message);
	return;
}

esqAllColumn

Выбор всех колонок ESQ

esq.allColumns = true;

esqRowCount

Выбор кол-ва записей ESQ

esq.rowCount = 1;

rndGuid

Рандомный Guid

e87e2d82-15d6-4802-b8b9-7bee25e4ed95

diffRemove

Diff удаление

Template
{
	"operation": "remove",
	"name": "Field"
},

diffMerge

Diff merge

Template
{
	"operation": "merge",
	"name": "Field",
	"values": {
		"layout": { "colSpan": 24, "column": 0, "row": 1 },
		"enabled": { "bindTo": "" },
		"isRequired": { "bindTo": "" },
	}
},

diffMove

Diff move

Template
{
	"operation": "move",
	"name": "Field",
	"parentName": "Parent",
	"propertyName": "items",
	"index": 0,
},

diffField

Diff insert field

Template
{
	"operation": "insert",
	"name": "Field",
	"parentName": "Header",
	"propertyName": "items",
	"values": {
		"bindTo": "Field",
		"layout": { "colSpan": 24, "column": 0, "row": 0 },
		"enabled": true,
		"isRequired": false,
		"visible": true
	}
},

diffTab

Diff insert tab

Template
{
	"operation": "insert",
	"name": "NameTab",
	"parentName": "Tabs",
	"propertyName": "tabs",
	"values": {
		"caption": { "bindTo": "Resources.Strings.NameTabCaption" },
		"items": [],
		"order": 1
	}
},

diffContainer

Diff insert container

Template
{
	"operation": "insert",
	"name": "NameContainer",
	"parentName": "Parent",
	"propertyName": "items",
	"values": {
		"itemType": Terrasoft.ViewItemType.CONTAINER,
		"items": []
	}
},

diffGridLayout

Diff insert grid layout

Template
{
	"operation": "insert",
	"name": "NameGridLayout",
	"parentName": "Parent",
	"propertyName": "items",
	"values": {
		"itemType": Terrasoft.ViewItemType.GRID_LAYOUT,
		"collapseEmptyRow": true,
		"items": []
	}
},

diffControlGroup

Diff insert control group

Template
{
	"operation": "insert",
	"name": "NameControlGroup",
	"parentName": "Parent",
	"propertyName": "items",
	"values": {
		"itemType": Terrasoft.ViewItemType.CONTROL_GROUP,
		"caption": { "bindTo": "Resources.Strings.NameControlGroupCaption" },
		"items": []
	}
},

diffDetail

Diff insert detail

Template
{
	"operation": "insert",
	"name": "DetailName",
	"parentName": "Parent",
	"propertyName": "items",
	"values": {
		"itemType": Terrasoft.ViewItemType.DETAIL
	}
},

diffButton

Diff insert button

Template
{
	"operation": "insert",
	"name": "NameButton",
	"parentName": "LeftContainer",
	"propertyName": "items",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": { "bindTo": "Resources.Strings.NameButtonCaption" },
		"visible": { "bindTo" : "IsNameVisible" },
		"enable": { "bindTo" : "IsNameEnable" },
		"click": { "bindTo": "onNameClick" },
		"classes": {
			"textClass": ["actions-button-margin-right"],
			"wrapperClass": ["actions-button-margin-right"]
		},
		"tag": "Name",
		"style": Terrasoft.controls.ButtonEnums.style.GREEN
	}
},

diffSectionButton

Diff insert button (для секции)

Template
{
	"operation": "insert",
	"name": "NameButton",
	"parentName": "CombinedModeActionButtonsCardLeftContainer",
	"propertyName": "items",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": {"bindTo": "Resources.Strings.NameButtonCaption"},
		"visible": { "bindTo": "IsNameVisible" },
		"enable": { "bindTo": "IsNameEnable" },
		"click": {"bindTo": "onCardAction"},
		"tag": "onNameClick",
		"style": Terrasoft.controls.ButtonEnums.style.GREEN,
		"classes": { "textClass": ["actions-button-margin-right"] }
	}
},

diffDetailButton

Diff insert detail button (в детали)

Template
{
	"operation": "insert",
	"name": "NameButton",
	"parentName": "Detail",
	"propertyName": "tools",
	"values": {
		"itemType": Terrasoft.ViewItemType.BUTTON,
		"caption": { "bindTo": "Resources.Strings.NameButtonCaption" },
		"visible": { "bindTo": "IsNameVisible" },
		"enabled": { "bindTo": "IsNameEnabled" },
		"click": { "bindTo": "onNameClick" }
	}
},

methodSectionResetVisible

Раздел. Сброс атрибутов отображения кнопок страницы. Нужно для сброса установленных со страницы значений отображения

Template
/**
 * @inheritdoc BaseDataView#openCard
 * @overridden
 */
openCard: function() {
	this.resetVisibleAttributes();
	this.callParent(arguments);
},

/**

  • @protected */ resetVisibleAttributes: function() { this.set("IsButtonVisible", false); },

methodGetSet

Установка атрибута отображения

Template
/**
 * @protected
 */
getIsNameVisible: function() {
	return true;
},

/**

  • @protected */ setIsNameVisible: function() { var isVisible = this.getIsNameVisible();

    this.set("IsNameVisible", isVisible, { publishToSection: true }); },


onEntityInitialized

Заготовка onEntityInitialized

Template
/**
 * @inheritdoc BasePageV2#onEntityInitialized
 * @overridden
 */
onEntityInitialized: function() {
	this.callParent(arguments);
},

initCallback

Заготовка init с callback

Template
/**
 * @inheritdoc BasePageV2#init
 * @overridden
 */
init: function(callback, scope) {
	this.callParent([function() {
		Ext.callback(callback, scope);
	}, this]);
},

init

Заготовка init

Template
/**
 * @inheritdoc BasePageV2#init
 * @overridden
 */
init: function() {
	this.callParent(arguments);
},

onDiscardChangesClick

Заготовка onDiscardChangesClick

Template
/**
 * @inheritdoc BasePageV2#onDiscardChangesClick
 * @overridden
 */
onDiscardChangesClick: function(callback, scope) {
	this.callParent([function() {
		Ext.callback(callback, scope);
	}, this]);
},

onSaved

Заготовка onSaved

Template
/**
 * @inheritdoc BasePageV2#onSaved
 * @overridden
 */
onSaved: function() {
	this.callParent(arguments);
},

subscribeDetailEvents

Подпись на сообщения детали

Template
/**
 * @inheritdoc BaseEntityPage#subscribeDetailEvents
 * @overridden
 */
subscribeDetailEvents: function(detailConfig, detailName) {
	this.callParent(arguments);
	var detailId = this.getDetailId(detailName);
this.sandbox.subscribe("...", this.method, this, [detailId]);

},


getDetailInfo

Заготовка getDetailInfo

Template
/**
 * @inheritdoc BasePageV2#getDetailInfo
 * @overridden
 */
getDetailInfo: function(detail) {
	var info = this.callParent(arguments);
	
	if (detail.detailName === "...") {
		/// code...
	}
return info;

},


destroy

Заготовка destroy

Template
/**
 * @inheritdoc BaseSchemaModuleV2#destroy
 * @overridden
 */
destroy: function() {
	/// code...
	this.callParent(arguments);
},

subscribeSandboxEvents

Подпись на сообщения

Template
/**
 * @inheritdoc BasePageV2#subscribeSandboxEvents
 * @overridden
 */
subscribeSandboxEvents: function() {
	this.callParent(arguments);
this.sandbox.subscribe("...", this.method, this, [this.sandbox.id]);

},


this_asyncValidate

Вызов и обработка asyncValidate

Template
this.asyncValidate(function(result) {
	if (!result.success) {
		this.showInformationDialog(result.message);
		return;
	}
this.save({
	isSilent: true,
	callback: this.method,
	scope: this
});

}, this);


asyncValidate

Расширение asyncValidate

Template
/**
 * @inheritdoc BasePageV2#asyncValidate
 * @overridden
 */
asyncValidate: function(callback, scope) {
	this.callParent([function(response) {
		if (!this.validateResponse(response)) {
			return;
		}
	this.validateMethod(function(result) {
		Ext.callback(callback, scope, [result]);
	});
}, this]);

},

/**

  • @protected */ validateMethod: function(callback, scope) { var result = { success: true, message: Terrasoft.emptyString };

    Ext.callback(callback, scope, [result]); },


asyncValidateChain

Расширение asyncValidate с chain

Template
/**
 * @inheritdoc BasePageV2#asyncValidate
 * @overridden
 */
asyncValidate: function(callback, scope) {
	this.callParent([function(response) {
		if (!this.validateResponse(response)) {
			return;
		}
	Terrasoft.chain(
		function(next) {
			this.validateMethod(next, this);
		},
		function(_next, result) {
			Ext.callback(callback, scope, [result]);
		}, this
	);
}, this]);

},

/**

  • @protected */ validateMethod: function(callback, scope) { var result = { success: true, message: Terrasoft.emptyString };

    Ext.callback(callback, scope, [result]); },


  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft