Creatio development guide
PDF
This documentation is valid for Creatio version 7.16.0. We recommend using the newest version of Creatio documentation.

Properties. The "properties" property

Glossary Item Box

Introduction

The “properties” property of the configuration object of the view model schema contains a JavaScript object that describes the properties of the view model.

An example of using the “properties” property in the SectionTabsSchema schema of the NUI package:

define("SectionTabsSchema", [],
        function() {
            return {
                ...
                // Declaring the "properties" property.
                properties: {
                    // The "parameters" property. Array.
                    parameters: [],
                    // The "modulesContainer" property. Object.
                    modulesContainer: {}
                },
                methods: {
                    ...
                    // Initialization method. Always executed first.
                    init: function(callback, scope) {
                        ...
                        // Calling a method that uses the properties of the view model.
                        this.initContainers();
                        ...
                    },
                    ...
                    // A method that uses the properties.
                    initContainers: function() {
                        // Using the "modulesContainer" propery.
                        this.modulesContainer.items = [];
                        ...
                        // Usting the "parameters" property.
                        this.Terrasoft.each(this.parameters, function(config) {
                            config = this.applyConfigs(config);
                            var moduleConfig = this.getModuleContainerConfig(config);
                            var initConfig = this.getInitConfig();
                            var container = viewGenerator.generatePartial(moduleConfig, initConfig)[0];
                            this.modulesContainer.items.push(container);
                        }, this);
                    },
                    ...
                },
            ...
            }
        });

© Creatio 2002-2020.

Did you find this information useful?

How can we improve it?