UIUtils
Extends:
A Utility class that contains generic functions needed in multiple places.
Static Method Summary
Static Public Methods | ||
public static |
addChild(parent: flexiciousNmsp.UIComponent, child: flexiciousNmsp.UIComponent, before: flexiciousNmsp.UIComponent) Adds a child to the provided display object. |
|
public static |
addDomEventListener(uiComponent: flexiciousNmsp.UIComponent, domElement: *, evt: *, f: Function) Add static DOM event listener to the UI component having DOM element |
|
public static |
addPopUp(pop: *, parent: *, modal: *, triggerEvent: *, title: *, actions: *): * Calls add popup. |
|
public static |
areArraysEqual(a1: *, a2: *): boolean Iterates through each array and returns false if either contains an element not contained within the other. |
|
public static |
attachClass(domElement: *, clsName: String) Attach style class to DOM elements |
|
public static |
Returns the average of all items the specified data provider |
|
public static |
capitalizeFirstLetterIfPrefix(prefix: *, val: *): * capitalize first letter if prefix exist |
|
public static |
checkGetterAndRetrieve(target: *, attrName: String): * Check whether attributes is already set and return value of that attribute |
|
public static |
checkSetterAndApply(target: *, attrName: String, val: *) Check whether attributes is already set and set value to it |
|
public static |
concatenateList(list: *, propertyName: *, delimiter: *): * Generates single string from collection of items, delimited by delimiter |
|
public static |
createDateFilter(description: *, fld: *, dateRange: *, start: *, end: *): * For prebuilt filters, short cut method to create date filter |
|
public static |
createExportPopup(): * |
|
public static |
createListFilter(description: *, fld: *, values: *): * For prebuilt filters, short cut method to create list based filters (ComboBox, MSCB) |
|
public static |
createRenderer(renderer: *, properties: *): * Used to create a filter renderer along with initialization properties |
|
public static |
|
|
public static |
createSettingsPopup(): * |
|
public static |
dataGridFormatCurrencyLabelFunction(item: *, dgColumn: *): * Datagrid function to format the currency column in a grid. |
|
public static |
dataGridFormatDateLabelFunction(item: *, dgColumn: *): * Datagrid function to format the date column in a grid. |
|
public static |
dataGridFormatYesNoLabelFunction(item: *, dgColumn: *): * Datagrid function to format the yes no column in a grid. |
|
public static |
dateCompare(a: *, b: *): * Compares the two Date objects and returns an integer value indicating if the first Date object is before, equal to, or after the second item. |
|
public static |
decimalToColor(d: Number, padding: *): string convert decimal color code to hexadecimal color code |
|
public static |
detachClass(domElement: *, clsName: String) Remove style class to DOM elements |
|
public static |
disableElement(elem: *) Disable a DOM element |
|
public static |
capitalize first letter |
|
public static |
change first letter to lower case |
|
public static |
doesArrayContainObjectValue(array: *, valFld: *, compareVal: *): * Iterates through an array to see if the "valFld" property of any of the |
|
public static |
doesArrayContainStringValue(array: *, compareVal: *): * Iterates through an array to see if the "toString" methods of any of the |
|
public static |
doesArrayContainValue(array: *, valFld: *, compareVal: *): * Iterates through an array to see if the toString of the "valFld" property of any of the |
|
public static |
emptyIfNull(val: Object): * check whether value is null or not |
|
public static |
ensureWithinView(popup: *, parent: *) |
|
public static |
escapeRegExp(str: String): String Escaped the escape character |
|
public static |
extractPropertyValues(source: *, propertyToExtract: *): * Given an array collection of complex objects, and a property, returns an array collection of the propertyToExtract values of each object within the array collection |
|
public static |
filterArray(arrayIn: Array, filter: flexiciousNmsp.Filter, grid: flexiciousNmsp.FlexDataGrid, level: flexiciousNmsp.FlexDataGridColumnLevel, hideIfNoChildren: Boolean): Array Provided an array, filters it on basis of the filter arguments. |
|
public static |
filterPageSort(flat: Array, filter: *, pages: *): Array Returns sorted array of pages |
|
public static |
filterRecursive(obj: *, filter: flexiciousNmsp.Filter, level: flexiciousNmsp.FlexDataGridColumnLevel, hideIfNoChildren: Boolean): Boolean if object do not have children, or none of them matched or object did not match and none of my children did either or there are are no recursing expressions its return false. |
|
public static |
findAncestorByClassName(elem: *, className: *): * find anscestor element of an element by its class name |
|
public static |
findElementWithClassName(parent: *, containerClassName: String): Object Fetch the first DOM element by class name |
|
public static |
findElementsWithClassName(parent: *, containerClassName: String): Array Fetch all the DOM elements by class name |
|
public static |
findFirstElementByTagName(parent: *, tagName: String): Object Fetch the first DOM element by tag name |
|
public static |
formatBoolean(val: *): * Takes in a boolean, returns a Yes or No |
|
public static |
formatCurrency(val: *, currencySymbol: *): * Takes in a number, and returns it formatted as Currency |
|
public static |
formatDate(date: Object, formatString: String): * Takes in a date, and returns it formatted as MM/DD/YY |
|
public static |
fromPersistenceString(host: *): * Takes in a specifically formatted strings and spits out an object that was used to make that string. |
|
public static |
getDateValue(dateStr: *, formatString: *): * |
|
public static |
getDomElementIndex(parent: *, child: *): * |
|
public static |
getGroupForColumn(grid: *, col: *): * Goes through columns of the passed in grid (or level for Ultimate) and checks to see if the given column is in a columnGroup. |
|
public static |
getLength(arr: *): * If arr is XML or XMLList, returns length() else returns length; |
|
public static |
getMouseWheelDelta(evt: *): * get wheel delta value on occuring mouse event |
|
public static |
getNearestJSObject(target: *): * Returns nearest json object |
|
public static |
getObjectProperty(data: *, property: *): * Returns property or subproperty (dot delimited) of an object |
|
public static |
getStyleValue(cell: flexiciousNmsp.FlexDataGridCell, styleProp: Object): * fetch style properties of cell |
|
public static |
getThemeById(themeID: *): * get theme by theme ID |
|
public static |
Returns the top level application. |
|
public static |
gradientFill(comp: *, colors: Array, paddingX: Number, paddingY: Number) Creates a gradient fill |
|
public static |
handleError(event: *) |
|
public static |
|
|
public static |
Returns true if method exists on the object specified. |
|
public static |
hasMethodOrProperty(obj: *, prop: String): Boolean Returns true if method or property with name prop exists on the object specified. |
|
public static |
isArray(input: *): * Returns true if passed in object is Array |
|
public static |
isChildRecursive(grp: *, col: *): boolean Is col a child of grp or any of its children? Added for Printing support of column groups |
|
public static |
isCloneable(input: *): * Returns true if passed in object is clonable |
|
public static |
isCompositeDataType(input: *): * Returns true if passed in object is Array or Object data type |
|
public static |
isIE(): * check whether browser is internet explorer or not |
|
public static |
isIE8(): * check whether browser is internet explorer 8.0 or not |
|
public static |
isInUIHierarchy(child: *, parent: *): boolean Returns true if parent exists somwhere in the parent hierarchy of the child. |
|
public static |
isMouseEvent(evt: *): Boolean check whether the event is a mouse event or not |
|
public static |
isMoz(): * check whether browser is Mozila Firefox or not |
|
public static |
isPrimitive(input: *): * Returns true if passed in object is a boolean, number or string |
|
public static |
isSpecialDataType(input: *): * Returns true if passed in object is a undefined or null data types. |
|
public static |
isStringNumeric(str: *): * Checks to see if the passed in value is a string representation of a numeric value |
|
public static |
isWebKit(): * check whether browser is Chrome or Webkit version or not |
|
public static |
labelObjectProperty(item: *, column: *): * Parses the value of a complex property and return its String equivalent |
|
public static |
labelObjectPropertyList(item: *, column: *): string Parses the value of a complex list property, concatenating string values of all elements. |
|
public static |
max(dataProvider: *, fld: *, comparisionType: *): * Returns the maximum value in the specified data provider |
|
public static |
mergeObjects(to: *, from: *) Merges the props of two objects. |
|
public static |
min(dataProvider: *, fld: *, comparisionType: *): * Returns the minimum value in the specified data provider |
|
public static |
Returns Zero if passed in input is NAN else returns input as is. |
|
public static |
numericCompare(a: *, b: *): * Compares two numeric values. |
|
public static |
numericCompare(a: Number, b: Number): Number Compare two numeric values if both of them NaN return 0 if a have NaN or b have NaN value then return 1 or -1 for each respective cases. |
|
public static |
objectAssign(target: *, firstSource: *): * The MIT License (MIT) |
|
public static |
get offset values of an element |
|
public static |
openBrowserPopup(url: *, options: *, useNew: *): * Opens a browser popup |
|
public static |
Returns array of pages |
|
public static |
pageArrayByPageNumbers(arrayIn: Array, pageIndexes: Array, pageSize: Number): Array returns array of pages by page number |
|
public static |
convert data object to xml |
|
public static |
pasteToClipBoard(strToPaste: *) Pastes the passed in data to the clipboard. |
|
public static |
positionComponent(relativeTo: *, itemToPosition: *, my: *, at: *, leftOffset: *, topOffset: *) |
|
public static |
recursiveMatch(items: *, filter: *, grid: *, level: *, recursingExpression: *): boolean |
|
public static |
removeAllChildren(parent: *) remove all children of the parent element |
|
public static |
removeChild(parent: *, child: *) remove child from parent element |
|
public static |
removeDomEventListener(domElement: *, evt: *, f: Function) Remove static DOM event listener from the UI component having DOM element using same function signature. |
|
public static |
removeFromArray(array: *, itemToRemove: *): * Removes the supplied item from the supplied array, and returns that array |
|
public static |
removePopUp(popup: *) |
|
public static |
resolveExpression(host: *, expression: *, valueToApply: *, returnUndefinedIfPropertyNotFound: *, applyNullValues: *, valueApplier: *): * A utility function that resolves expressions like x.y.z (for complex object dataField Support) Also used to apply values. |
|
public static |
set html text to DOM element |
|
public static |
set plain text to DOM element |
|
public static |
setupInputMask(input: *, options: *) |
|
public static |
setupWaterMark(input: *, options: *) |
|
public static |
showConfirm(msg: *, parent: *, modal: *, title: *, features: *) A utility function that encapsulates the task of showing a confirmation popup. |
|
public static |
showError(errorMessage: *, errorTitle: *) Shows a popup with an error message |
|
public static |
showMessage(message: *, title: *, flag: *) Shows a popup with an informational message |
|
public static |
showToaster(message: *, title: *, type: *, toasterPosition: *, animationDuration: *, visibleDuration: *, moveAnimate: *, fadeAnimate: *) |
|
public static |
showTooltip(relativeTo: *, tooltip: *, dataContext: *, point: *, leftOffset: *, topOffset: *, offScreenMath: *, where: *, container: *, bounds: *) Displays a tooltip for the control in question. |
|
public static |
sortArray(arrayIn: *, sorts: *): * Sorts the given array |
|
public static |
Sort array with property and whether there have any numeric data or not |
|
public static |
stringCompare(a: *, b: *, caseInsensitive: *): * Compares two String values. |
|
public static |
stringToDate(valueString: String, inputFormat: String): * convert string to date object |
|
public static |
sum(dataProvider: *, fld: *): * Returns the sum of all items the specified data provider |
|
public static |
toPersistenceString(host: *): * Returns a specially formatted string that stores information about the type. |
|
public static |
Returns the string value of the passed in object, or if null, returns an empty string. |
|
public static |
toStringSafe(host: *): string Returns the string value of the passed in object, or if null, returns an empty string. |
|
public static |
traceData(obj: *) |
|
public static |
convert xml to json string or data object |
Method Summary
Public Methods | ||
public |
getClassNames(): string[] |
Inherited Summary
From class TypedObject | ||
public |
typeCache: {} |
|
public |
|
|
public |
Returns a list of strings that represent the object hierarchy for this object. |
|
public |
implementsOrExtends(name: *): Boolean Returns true if the class name to check is in the list of class names defined for this class. |
Static Public Methods
public static addChild(parent: flexiciousNmsp.UIComponent, child: flexiciousNmsp.UIComponent, before: flexiciousNmsp.UIComponent) source
Adds a child to the provided display object. Takes into account the scenario where the parent is a Spark application.
Params:
Name | Type | Attribute | Description |
parent | flexiciousNmsp.UIComponent | ||
child | flexiciousNmsp.UIComponent | ||
before | flexiciousNmsp.UIComponent |
public static addDomEventListener(uiComponent: flexiciousNmsp.UIComponent, domElement: *, evt: *, f: Function) source
Add static DOM event listener to the UI component having DOM element
Params:
Name | Type | Attribute | Description |
uiComponent | flexiciousNmsp.UIComponent | ||
domElement | * | ||
evt | * | ||
f | Function |
public static addPopUp(pop: *, parent: *, modal: *, triggerEvent: *, title: *, actions: *): * source
Calls add popup.
Params:
Name | Type | Attribute | Description |
pop | * | ||
parent | * | ||
modal | * | ||
triggerEvent | * | If you specify this, it will move the popup right below the mouse click |
|
title | * | ||
actions | * | callbackFunctionDetail - a callback wrapper for the popup getting close. it should be { context : this, method : onPopupClosed. // which means this.onPopupClosed. } |
Return:
* |
public static areArraysEqual(a1: *, a2: *): boolean source
Iterates through each array and returns false if either contains an element not contained within the other.
Params:
Name | Type | Attribute | Description |
a1 | * | ||
a2 | * |
public static attachClass(domElement: *, clsName: String) source
Attach style class to DOM elements
Params:
Name | Type | Attribute | Description |
domElement | * | ||
clsName | String |
public static average(dataProvider: *, fld: *): number source
Returns the average of all items the specified data provider
Params:
Name | Type | Attribute | Description |
dataProvider | * | ||
fld | * |
public static capitalizeFirstLetterIfPrefix(prefix: *, val: *): * source
capitalize first letter if prefix exist
Params:
Name | Type | Attribute | Description |
prefix | * | ||
val | * |
Return:
* |
public static checkGetterAndRetrieve(target: *, attrName: String): * source
Check whether attributes is already set and return value of that attribute
Params:
Name | Type | Attribute | Description |
target | * | ||
attrName | String |
Return:
* |
public static checkSetterAndApply(target: *, attrName: String, val: *) source
Check whether attributes is already set and set value to it
Params:
Name | Type | Attribute | Description |
target | * | ||
attrName | String | ||
val | * |
public static concatenateList(list: *, propertyName: *, delimiter: *): * source
Generates single string from collection of items, delimited by delimiter
Params:
Name | Type | Attribute | Description |
list | * | array of objects |
|
propertyName | * | name of a property to be included, may be a complex "." delimited property name |
|
delimiter | * | a delimiter between elements in the string, by default it's ", " |
Return:
* |
public static createDateFilter(description: *, fld: *, dateRange: *, start: *, end: *): * source
For prebuilt filters, short cut method to create date filter
Params:
Name | Type | Attribute | Description |
description | * | Name of the filter (to show in filter dropdown) |
|
fld | * | DataField of the column to apply filter to |
|
dateRange | * | One of the DateRange constants (See the DateRange object) |
|
start | * | If you specify DateRange=Custom, the start date for the custom range |
|
end | * | If you specify DateRange=Custom, the end date for the custom range |
Return:
* | A Filter object that contains the passed in fld and date range in the arguments collection. |
public static createListFilter(description: *, fld: *, values: *): * source
For prebuilt filters, short cut method to create list based filters (ComboBox, MSCB)
Params:
Name | Type | Attribute | Description |
description | * | Name of the filter (to show in filter dropdown) |
|
fld | * | DataField of the column to apply filter to |
|
values | * | An array of strings that represents the dataField of the filter list control |
Return:
* | A Filter object that contains the passed in fld and values in the arguments collection. |
public static createRenderer(renderer: *, properties: *): * source
Used to create a filter renderer along with initialization properties
Params:
Name | Type | Attribute | Description |
renderer | * | Class factory to be used as the generator |
|
properties | * | Initialization properties. |
Return:
* | The created renderer factory |
public static dataGridFormatCurrencyLabelFunction(item: *, dgColumn: *): * source
Datagrid function to format the currency column in a grid.
Params:
Name | Type | Attribute | Description |
item | * | ||
dgColumn | * |
Return:
* | A formatted currency string |
public static dataGridFormatDateLabelFunction(item: *, dgColumn: *): * source
Datagrid function to format the date column in a grid.
Params:
Name | Type | Attribute | Description |
item | * | ||
dgColumn | * |
Return:
* | A formatted date string |
public static dataGridFormatYesNoLabelFunction(item: *, dgColumn: *): * source
Datagrid function to format the yes no column in a grid.
Params:
Name | Type | Attribute | Description |
item | * | ||
dgColumn | * |
Return:
* | A formatted boolean string |
public static dateCompare(a: *, b: *): * source
Compares the two Date objects and returns an integer value indicating if the first Date object is before, equal to, or after the second item.
Params:
Name | Type | Attribute | Description |
a | * | Date object. |
|
b | * | Date object. |
Return:
* | 0 if |
public static decimalToColor(d: Number, padding: *): string source
convert decimal color code to hexadecimal color code
Params:
Name | Type | Attribute | Description |
d | Number | ||
padding | * |
public static detachClass(domElement: *, clsName: String) source
Remove style class to DOM elements
Params:
Name | Type | Attribute | Description |
domElement | * | ||
clsName | String |
public static disableElement(elem: *) source
Disable a DOM element
Params:
Name | Type | Attribute | Description |
elem | * |
public static doCap(val: String): * source
capitalize first letter
Params:
Name | Type | Attribute | Description |
val | String |
Return:
* |
public static doLower(val: String): * source
change first letter to lower case
Params:
Name | Type | Attribute | Description |
val | String |
Return:
* |
public static doesArrayContainObjectValue(array: *, valFld: *, compareVal: *): * source
Iterates through an array to see if the "valFld" property of any of the
items in the a1 array equals "compareVal"
Params:
Name | Type | Attribute | Description |
array | * | Array to search |
|
valFld | * | Property of the objects in the array |
|
compareVal | * | The value to compare against. |
Return:
* | The first object that matches the search criteria, null if no match |
public static doesArrayContainStringValue(array: *, compareVal: *): * source
Iterates through an array to see if the "toString" methods of any of the
items in the a1 array equals "compareVal"
Params:
Name | Type | Attribute | Description |
array | * | Array to search |
|
compareVal | * | The value to compare against. |
Return:
* | The first object that matches the search criteria, null if no match |
public static doesArrayContainValue(array: *, valFld: *, compareVal: *): * source
Iterates through an array to see if the toString of the "valFld" property of any of the
items in the array array equals "compareVal"
Params:
Name | Type | Attribute | Description |
array | * | Array to search |
|
valFld | * | Property of the objects in the array |
|
compareVal | * | The value to compare against. |
Return:
* |
public static emptyIfNull(val: Object): * source
check whether value is null or not
Params:
Name | Type | Attribute | Description |
val | Object |
Return:
* |
public static ensureWithinView(popup: *, parent: *) source
Params:
Name | Type | Attribute | Description |
popup | * | ||
parent | * |
public static escapeRegExp(str: String): String source
Escaped the escape character
Params:
Name | Type | Attribute | Description |
str | String |
public static extractPropertyValues(source: *, propertyToExtract: *): * source
Given an array collection of complex objects, and a property, returns an array collection of the propertyToExtract values of each object within the array collection
Params:
Name | Type | Attribute | Description |
source | * | A list of objects that contain the property to extract |
|
propertyToExtract | * | The name of the property to extract |
Return:
* | An array collection of the extracted property values |
public static filterArray(arrayIn: Array, filter: flexiciousNmsp.Filter, grid: flexiciousNmsp.FlexDataGrid, level: flexiciousNmsp.FlexDataGridColumnLevel, hideIfNoChildren: Boolean): Array source
Provided an array, filters it on basis of the filter arguments. Returns a new array that only contains the values that match filters.
public static filterPageSort(flat: Array, filter: *, pages: *): Array source
Returns sorted array of pages
Params:
Name | Type | Attribute | Description |
flat | Array | array of total pages |
|
filter | * | instance of filter |
|
pages | * | number of pages |
public static filterRecursive(obj: *, filter: flexiciousNmsp.Filter, level: flexiciousNmsp.FlexDataGridColumnLevel, hideIfNoChildren: Boolean): Boolean source
if object do not have children, or none of them matched or object did not match and none of my children did either or there are are no recursing expressions its return false.
if hideIfNoChildren=false
and object matched or object didn't match but atleast one of its children matched or there have nothing to filter its return true.
Filter data of all level of data grid recursively using defind filter function
Params:
Name | Type | Attribute | Description |
obj | * | ||
filter | flexiciousNmsp.Filter | ||
level | flexiciousNmsp.FlexDataGridColumnLevel | ||
hideIfNoChildren | Boolean |
public static findAncestorByClassName(elem: *, className: *): * source
find anscestor element of an element by its class name
Params:
Name | Type | Attribute | Description |
elem | * | ||
className | * |
Return:
* | return ancestor element or null |
public static findElementWithClassName(parent: *, containerClassName: String): Object source
Fetch the first DOM element by class name
Params:
Name | Type | Attribute | Description |
parent | * | ||
containerClassName | String |
public static findElementsWithClassName(parent: *, containerClassName: String): Array source
Fetch all the DOM elements by class name
Params:
Name | Type | Attribute | Description |
parent | * | ||
containerClassName | String |
public static findFirstElementByTagName(parent: *, tagName: String): Object source
Fetch the first DOM element by tag name
Params:
Name | Type | Attribute | Description |
parent | * | ||
tagName | String |
public static formatBoolean(val: *): * source
Takes in a boolean, returns a Yes or No
Params:
Name | Type | Attribute | Description |
val | * | Boolean indicator to format |
Return:
* | The formatted yes or no string |
public static formatCurrency(val: *, currencySymbol: *): * source
Takes in a number, and returns it formatted as Currency
Params:
Name | Type | Attribute | Description |
val | * | The number to format |
|
currencySymbol | * |
Return:
* | The formatted currency string |
public static formatDate(date: Object, formatString: String): * source
Takes in a date, and returns it formatted as MM/DD/YY
Return:
* | The formatted date string |
public static fromPersistenceString(host: *): * source
Takes in a specifically formatted strings and spits out an object that was used to make that string.
Params:
Name | Type | Attribute | Description |
host | * |
Return:
* |
public static getDateValue(dateStr: *, formatString: *): * source
Params:
Name | Type | Attribute | Description |
dateStr | * | ||
formatString | * |
Return:
* |
public static getDomElementIndex(parent: *, child: *): * source
Params:
Name | Type | Attribute | Description |
parent | * | ||
child | * |
Return:
* |
public static getGroupForColumn(grid: *, col: *): * source
Goes through columns of the passed in grid (or level for Ultimate) and checks to see if the given column is in a columnGroup. If yes, returns the top level Column Group for it. Added for Printing support of column groups
Params:
Name | Type | Attribute | Description |
grid | * | EADG, FDG or FDGCL |
|
col | * | EADGC or FDGC |
Return:
* | ADGCG or FDGCG |
public static getLength(arr: *): * source
If arr is XML or XMLList, returns length() else returns length;
Params:
Name | Type | Attribute | Description |
arr | * |
Return:
* |
public static getMouseWheelDelta(evt: *): * source
get wheel delta value on occuring mouse event
Params:
Name | Type | Attribute | Description |
evt | * |
Return:
* | wheel data value |
public static getNearestJSObject(target: *): * source
Returns nearest json object
Params:
Name | Type | Attribute | Description |
target | * |
Return:
* |
public static getObjectProperty(data: *, property: *): * source
Returns property or subproperty (dot delimited) of an object
Params:
Name | Type | Attribute | Description |
data | * | The source object |
|
property | * | The name of the property with the path if dot-delimited |
Return:
* |
public static getStyleValue(cell: flexiciousNmsp.FlexDataGridCell, styleProp: Object): * source
fetch style properties of cell
Params:
Name | Type | Attribute | Description |
cell | flexiciousNmsp.FlexDataGridCell | ||
styleProp | Object |
Return:
* |
public static getThemeById(themeID: *): * source
get theme by theme ID
Params:
Name | Type | Attribute | Description |
themeID | * |
Return:
* |
public static gradientFill(comp: *, colors: Array, paddingX: Number, paddingY: Number) source
Creates a gradient fill
public static handleError(event: *) source
Params:
Name | Type | Attribute | Description |
event | * |
public static hasMethod(obj: *, prop: String): Boolean source
Returns true if method exists on the object specified.
Params:
Name | Type | Attribute | Description |
obj | * | ||
prop | String |
public static hasMethodOrProperty(obj: *, prop: String): Boolean source
Returns true if method or property with name prop exists on the object specified.
Params:
Name | Type | Attribute | Description |
obj | * | ||
prop | String |
public static isArray(input: *): * source
Returns true if passed in object is Array
Params:
Name | Type | Attribute | Description |
input | * |
Return:
* |
public static isChildRecursive(grp: *, col: *): boolean source
Is col a child of grp or any of its children? Added for Printing support of column groups
Params:
Name | Type | Attribute | Description |
grp | * | ||
col | * |
public static isCloneable(input: *): * source
Returns true if passed in object is clonable
Params:
Name | Type | Attribute | Description |
input | * |
Return:
* |
public static isCompositeDataType(input: *): * source
Returns true if passed in object is Array or Object data type
Params:
Name | Type | Attribute | Description |
input | * |
Return:
* |
public static isInUIHierarchy(child: *, parent: *): boolean source
Returns true if parent exists somwhere in the parent hierarchy of the child.
Params:
Name | Type | Attribute | Description |
child | * | ||
parent | * |
public static isMouseEvent(evt: *): Boolean source
check whether the event is a mouse event or not
Params:
Name | Type | Attribute | Description |
evt | * |
public static isPrimitive(input: *): * source
Returns true if passed in object is a boolean, number or string
Params:
Name | Type | Attribute | Description |
input | * |
Return:
* |
public static isSpecialDataType(input: *): * source
Returns true if passed in object is a undefined or null data types.
Params:
Name | Type | Attribute | Description |
input | * |
Return:
* |
public static isStringNumeric(str: *): * source
Checks to see if the passed in value is a string representation of a numeric value
Params:
Name | Type | Attribute | Description |
str | * | The string representation to check |
Return:
* | True if str is a string representation of a number value |
public static isWebKit(): * source
check whether browser is Chrome or Webkit version or not
Return:
* |
public static labelObjectProperty(item: *, column: *): * source
Parses the value of a complex property and return its String equivalent
Params:
Name | Type | Attribute | Description |
item | * | the source object |
|
column | * | the DataGridColumn object. Its dataField property gets the property path with name |
Return:
* |
public static labelObjectPropertyList(item: *, column: *): string source
Parses the value of a complex list property, concatenating string values of all elements. To specify field name and display field name use dataField="dataField/displayPropertyName/delimiter", where "dataField" is the field name, and "displayPropertyName" is the display field of elements in the list, and "delimiter" is the delimiter string to be used (optional).
Params:
Name | Type | Attribute | Description |
item | * | the source object |
|
column | * | the DataGridColumn object. Its dataField property gets the property path with name |
public static max(dataProvider: *, fld: *, comparisionType: *): * source
Returns the maximum value in the specified data provider
Params:
Name | Type | Attribute | Description |
dataProvider | * | ||
fld | * | ||
comparisionType | * |
Return:
* |
public static mergeObjects(to: *, from: *) source
Merges the props of two objects.
Params:
Name | Type | Attribute | Description |
to | * | ||
from | * |
public static min(dataProvider: *, fld: *, comparisionType: *): * source
Returns the minimum value in the specified data provider
Params:
Name | Type | Attribute | Description |
dataProvider | * | ||
fld | * | ||
comparisionType | * |
Return:
* |
public static nanToZero(input: Number): Number source
Returns Zero if passed in input is NAN else returns input as is.
Params:
Name | Type | Attribute | Description |
input | Number |
public static numericCompare(a: *, b: *): * source
Compares two numeric values.
Params:
Name | Type | Attribute | Description |
a | * | First number. |
|
b | * | Second number. |
Return:
* | 0 is both numbers are NaN.
1 if only |
public static numericCompare(a: Number, b: Number): Number source
Compare two numeric values if both of them NaN return 0 if a have NaN or b have NaN value then return 1 or -1 for each respective cases. if a greater than b then return -1 otherwise return 1 if both are equal then return 0
public static objectAssign(target: *, firstSource: *): * source
The MIT License (MIT)
Copyright (c) 2015 Rubén Norte
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Params:
Name | Type | Attribute | Description |
target | * | ||
firstSource | * |
Return:
* |
public static offset(el: *): Object source
get offset values of an element
Params:
Name | Type | Attribute | Description |
el | * |
public static openBrowserPopup(url: *, options: *, useNew: *): * source
Opens a browser popup
Params:
Name | Type | Attribute | Description |
url | * | The URL to open |
|
options | * |
|
Options string, defaults to width=800,height=600,lef t=0,top=0, toolbar=No,location=No,scrollbars=Yes,status=No,resizable=No,fullscreen=No |
useNew | * |
|
If true, creates a new window, else reuses the existing one. Defaults to true |
Return:
* |
public static pageArray(arrayIn: Array, pageIndex: Number, pageSize: Number): Array source
Returns array of pages
public static pageArrayByPageNumbers(arrayIn: Array, pageIndexes: Array, pageSize: Number): Array source
returns array of pages by page number
public static parseXML(data: Object): Object source
convert data object to xml
Params:
Name | Type | Attribute | Description |
data | Object |
public static pasteToClipBoard(strToPaste: *) source
Pastes the passed in data to the clipboard.
Params:
Name | Type | Attribute | Description |
strToPaste | * |
public static positionComponent(relativeTo: *, itemToPosition: *, my: *, at: *, leftOffset: *, topOffset: *) source
Params:
Name | Type | Attribute | Description |
relativeTo | * | ||
itemToPosition | * | ||
my | * | ||
at | * | ||
leftOffset | * | ||
topOffset | * |
public static recursiveMatch(items: *, filter: *, grid: *, level: *, recursingExpression: *): boolean source
Params:
Name | Type | Attribute | Description |
items | * | ||
filter | * | ||
grid | * | ||
level | * | ||
recursingExpression | * |
public static removeAllChildren(parent: *) source
remove all children of the parent element
Params:
Name | Type | Attribute | Description |
parent | * |
public static removeChild(parent: *, child: *) source
remove child from parent element
Params:
Name | Type | Attribute | Description |
parent | * | ||
child | * |
public static removeDomEventListener(domElement: *, evt: *, f: Function) source
Remove static DOM event listener from the UI component having DOM element using same function signature.
Params:
Name | Type | Attribute | Description |
domElement | * | ||
evt | * | ||
f | Function |
public static removeFromArray(array: *, itemToRemove: *): * source
Removes the supplied item from the supplied array, and returns that array
Params:
Name | Type | Attribute | Description |
array | * | The array to remove the item from |
|
itemToRemove | * | The item to remove |
Return:
* |
public static removePopUp(popup: *) source
Params:
Name | Type | Attribute | Description |
popup | * |
public static resolveExpression(host: *, expression: *, valueToApply: *, returnUndefinedIfPropertyNotFound: *, applyNullValues: *, valueApplier: *): * source
A utility function that resolves expressions like x.y.z (for complex object dataField Support) Also used to apply values. For example, if dataField=x.y.z, we can apply x.y.z=valueToApply.
Params:
Name | Type | Attribute | Description |
host | * | ||
expression | * | ||
valueToApply | * | ||
returnUndefinedIfPropertyNotFound | * | ||
applyNullValues | * | ||
valueApplier | * |
Return:
* |
public static setHtml(elem: *, html: String) source
set html text to DOM element
Params:
Name | Type | Attribute | Description |
elem | * | ||
html | String |
public static setText(elem: *, text: String) source
set plain text to DOM element
Params:
Name | Type | Attribute | Description |
elem | * | ||
text | String |
public static setupInputMask(input: *, options: *) source
Params:
Name | Type | Attribute | Description |
input | * | ||
options | * |
public static setupWaterMark(input: *, options: *) source
Params:
Name | Type | Attribute | Description |
input | * | ||
options | * |
public static showConfirm(msg: *, parent: *, modal: *, title: *, features: *) source
A utility function that encapsulates the task of showing a confirmation popup.
Params:
Name | Type | Attribute | Description |
msg | * | Text string that appears in the Alert control. |
|
parent | * | Object upon which the confirm dialog centers itself. |
|
modal | * | Flag represents if this is a modal window or not |
|
title | * | Text string that appears in the title bar. |
|
features | * | An array of objects having the details about the flag, class(style) and its callback function |
public static showError(errorMessage: *, errorTitle: *) source
Shows a popup with an error message
Params:
Name | Type | Attribute | Description |
errorMessage | * | Text string that appears in the Alert control. |
|
errorTitle | * |
|
Text string that appears in the title bar. |
public static showMessage(message: *, title: *, flag: *) source
Shows a popup with an informational message
Params:
Name | Type | Attribute | Description |
message | * | Text string that appears in the Alert control. |
|
title | * | Text string that appears in the title bar. |
|
flag | * | Test string which represents the type of message. e.g error |
public static showToaster(message: *, title: *, type: *, toasterPosition: *, animationDuration: *, visibleDuration: *, moveAnimate: *, fadeAnimate: *) source
Params:
Name | Type | Attribute | Description |
message | * | ||
title | * | ||
type | * | ||
toasterPosition | * | ||
animationDuration | * | ||
visibleDuration | * | ||
moveAnimate | * | ||
fadeAnimate | * |
public static showTooltip(relativeTo: *, tooltip: *, dataContext: *, point: *, leftOffset: *, topOffset: *, offScreenMath: *, where: *, container: *, bounds: *) source
Displays a tooltip for the control in question. The tooltip will disappear if the mouse moves over an area that is not the 'relativeTo' component or the tooltip component..
Params:
Name | Type | Attribute | Description |
relativeTo | * | Which component to position the popup relative to |
|
tooltip | * | The popup to display |
|
dataContext | * | If the popup has a data property, it will be set to this value |
|
point | * | If you specify this, the relativeTo is ignored, and the popup appears at the exact point you specify. Please ensure that the X and Y are relative to the Grid. |
|
leftOffset | * | Whether to shift the popup left after calculating the positions, for customizing the actual position |
|
topOffset | * | Whether to shift the popup top after calculating the positions, for customizing the actual position |
|
offScreenMath | * | Whether or not to adjust the popup if it appears off screen |
|
where | * | One of three values, left, right or none. If left, positions to bottom left, if right, positions to bottom right, if none, positions right below the relativeTo component. |
|
container | * | The holder for the tooltip, defaults to UIUtils.getTopLevelApplication(). You may need to override in multi window Air apps. |
|
bounds | * | By default, the tooltip will go away once you hover the mouse out of the trigger cell or the tooltip and stayed that way for tooltipWatcherTimeout. You may also manually remove the tooltip by calling the hideToolTip() function. |
public static sortArray(arrayIn: *, sorts: *): * source
Sorts the given array
Params:
Name | Type | Attribute | Description |
arrayIn | * | ||
sorts | * |
Return:
* |
public static sortOn(arr: Array, prop: String, numeric: Boolean): Array source
Sort array with property and whether there have any numeric data or not
public static stringCompare(a: *, b: *, caseInsensitive: *): * source
Compares two String values.
Params:
Name | Type | Attribute | Description |
a | * | First String value. |
|
b | * | Second String value. |
|
caseInsensitive | * | Specifies to perform a case insensitive compare,
|
Return:
* | 0 is both Strings are null.
1 if only |
public static stringToDate(valueString: String, inputFormat: String): * source
convert string to date object
Return:
* | returns date object |
public static sum(dataProvider: *, fld: *): * source
Returns the sum of all items the specified data provider
Params:
Name | Type | Attribute | Description |
dataProvider | * | ||
fld | * |
Return:
* |
public static toPersistenceString(host: *): * source
Returns a specially formatted string that stores information about the type. Used by preference persistence serialization, can handle array, arraycollection and primitives.
Params:
Name | Type | Attribute | Description |
host | * |
Return:
* |
public static toString(host: *): string source
Returns the string value of the passed in object, or if null, returns an empty string.
Params:
Name | Type | Attribute | Description |
host | * |
public static toStringSafe(host: *): string source
Returns the string value of the passed in object, or if null, returns an empty string.
Params:
Name | Type | Attribute | Description |
host | * |
public static traceData(obj: *) source
Params:
Name | Type | Attribute | Description |
obj | * |
Public Methods
public getClassNames(): string[] source
Returns a list of strings that represent the object hierarchy for this object.