IDE: Common Utilities
js/app/system/common.js is a library of system utilities, which defines some ExtJS objects.
The library of system utilities defines the following objects:
- Ext.data.proxy.Ajax, so as to send all create, read and destroy requests by means of ‘POST” method;
- Ext.data.AbstractStore by adding ‘exception’ system handler;
- Ext.tree.TreePanel by adding getChecked method to get the checked nodes.
The library uses the ‘app’ name space and contains a set of system functions and common objects.
- app.comboModel - a model for ComboBox data using the fields: id - int, title - string fields;
- app.comboStringModel - a model for ComboBox data using the fields: id - string, title - string;
- app.comboValueModel - model for ComboBox data using the fields: name - string, value - string;
- app.versionRenderer - a specialized renderer for the ‘Document version’ column showing the information on the versioned objects;
- app.creatorRenderer - a specialized renderer for the ‘Object author’ column;
- app.updaterRenderer - a specialized renderer for the ‘Last update author’ column;
- app.comboBoxRenderer(combo) - column renderer based on ComboBox data;
- app.linesRenderer - a specialized column renderer allowing to show a value on several lines (supports line breaks, does not hide the content outside column borders);
- app.sotrColumn - Grid column, which allows for sorting and removing elements;
- app.checkHeight(size) - a method verifying the component’s height value and returning the maximum available size if the component size does not fit the window (to be used for window only);
- app.checkWidth(size) - the same, but for verifying the width;
- app.checkSize(window) - verifies size and coordinates of the Ext.Window and reduces the size/ changes coordinates of the window if it goes beyond the visible area;
- app.checkboxRenderer - a renderer for boolean data such as and icons containing ‘yes’ and ‘no’ tooltips;
- app.publishRenderer - a renderer for boolean data such as and icons containing ‘published’ and ‘not published’ tooltips;
- app.formFailure - failure event handler when sending a form (to be defined manually);
- app.ajaxFailure - failure event handler when sending an Ajax-request (to be defined manually);
- app.storeException - exception handler when trying to upload data to store;
- app.createUrl([array]) - a method creating url-address considering backend routing features and taking an array of address elements as an argument;
- app.collectStoreData(store, onlyChanged) - a method getting the Data Store data, all or modified data is available for collecting, which is defined by the second parameter;
- app.checkChildNodes(node, isChecked) - recursive set up of the checked property for a tree node.