Home Reference Source
public class | source

UIUtils

Extends:

TypedObject → UIUtils

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

average(dataProvider: *, fld: *): number

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
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
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

doCap(val: String): *

capitalize first letter

public static

doLower(val: String): *

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
items in the a1 array equals "compareVal"

public static

doesArrayContainStringValue(array: *, compareVal: *): *

Iterates through an array to see if the "toString" methods of any of the
items in the a1 array equals "compareVal"

public static

doesArrayContainValue(array: *, valFld: *, compareVal: *): *

Iterates through an array to see if the toString of the "valFld" property of any of the
items in the array array equals "compareVal"

public static

emptyIfNull(val: Object): *

check whether value is null or not

public static

ensureWithinView(popup: *, parent: *)

public static

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

hasMethod(obj: *, prop: String): Boolean

Returns true if method exists on the object specified.

public static

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

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

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

offset(el: *): Object

get offset values of an element

public static

openBrowserPopup(url: *, options: *, useNew: *): *

Opens a browser popup

public static

pageArray(arrayIn: Array, pageIndex: Number, pageSize: Number): Array

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

setHtml(elem: *, html: String)

set html text to DOM element

public static

setText(elem: *, text: String)

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

sortOn(arr: Array, prop: String, numeric: Boolean): Array

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

toString(host: *): string

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

xml2json(xml: *, tab: *, returnObject: *): Object | String

convert xml to json string or data object

Method Summary

Public Methods
public

Inherited Summary

From class TypedObject
public

typeCache: {}

public
public

Returns a list of strings that represent the object hierarchy for this object.

public

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
uiComponent flexiciousNmsp.UIComponent
domElement *
evt *
f Function

public static addPopUp(pop: *, parent: *, modal: *, triggerEvent: *, title: *, actions: *): * source

Calls add popup.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
a1 *
a2 *

Return:

boolean

public static attachClass(domElement: *, clsName: String) source

Attach style class to DOM elements

Params:

NameTypeAttributeDescription
domElement *
clsName String

public static average(dataProvider: *, fld: *): number source

Returns the average of all items the specified data provider

Params:

NameTypeAttributeDescription
dataProvider *
fld *

Return:

number

public static capitalizeFirstLetterIfPrefix(prefix: *, val: *): * source

capitalize first letter if prefix exist

Params:

NameTypeAttributeDescription
prefix *
val *

Return:

*

public static checkGetterAndRetrieve(target: *, attrName: String): * source

Check whether attributes is already set and return value of that attribute

Params:

NameTypeAttributeDescription
target *
attrName String

Return:

*

public static checkSetterAndApply(target: *, attrName: String, val: *) source

Check whether attributes is already set and set value to it

Params:

NameTypeAttributeDescription
target *
attrName String
val *

public static concatenateList(list: *, propertyName: *, delimiter: *): * source

Generates single string from collection of items, delimited by delimiter

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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 createExportPopup(): * source

Return:

*

public static createListFilter(description: *, fld: *, values: *): * source

For prebuilt filters, short cut method to create list based filters (ComboBox, MSCB)

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
renderer *

Class factory to be used as the generator

properties *

Initialization properties.

Return:

*

The created renderer factory

public static createSaveSettingsPopup(): * source

Return:

*

public static createSettingsPopup(): * source

Return:

*

public static dataGridFormatCurrencyLabelFunction(item: *, dgColumn: *): * source

Datagrid function to format the currency column in a grid.

Params:

NameTypeAttributeDescription
item *
dgColumn *

Return:

*

A formatted currency string

public static dataGridFormatDateLabelFunction(item: *, dgColumn: *): * source

Datagrid function to format the date column in a grid.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
a *

Date object.

b *

Date object.

Return:

*

0 if a and b are equal (or both are null); -1 if a is before b (or b is null); 1 if a is after b (or a is null).

public static decimalToColor(d: Number, padding: *): string source

convert decimal color code to hexadecimal color code

Params:

NameTypeAttributeDescription
d Number
padding *

Return:

string

public static detachClass(domElement: *, clsName: String) source

Remove style class to DOM elements

Params:

NameTypeAttributeDescription
domElement *
clsName String

public static disableElement(elem: *) source

Disable a DOM element

Params:

NameTypeAttributeDescription
elem *

public static doCap(val: String): * source

capitalize first letter

Params:

NameTypeAttributeDescription
val String

Return:

*

public static doLower(val: String): * source

change first letter to lower case

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
val Object

Return:

*

public static ensureWithinView(popup: *, parent: *) source

Params:

NameTypeAttributeDescription
popup *
parent *

public static escapeRegExp(str: String): String source

Escaped the escape character

Params:

NameTypeAttributeDescription
str String

Return:

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:

NameTypeAttributeDescription
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.

Params:

NameTypeAttributeDescription
arrayIn Array
filter flexiciousNmsp.Filter
grid flexiciousNmsp.FlexDataGrid
level flexiciousNmsp.FlexDataGridColumnLevel
hideIfNoChildren Boolean

Return:

Array

returns filtered array.

public static filterPageSort(flat: Array, filter: *, pages: *): Array source

Returns sorted array of pages

Params:

NameTypeAttributeDescription
flat Array

array of total pages

filter *

instance of filter

pages *

number of pages

Return:

Array

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:

NameTypeAttributeDescription
obj *
filter flexiciousNmsp.Filter
level flexiciousNmsp.FlexDataGridColumnLevel
hideIfNoChildren Boolean

Return:

Boolean

public static findAncestorByClassName(elem: *, className: *): * source

find anscestor element of an element by its class name

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
parent *
containerClassName String

Return:

Object

public static findElementsWithClassName(parent: *, containerClassName: String): Array source

Fetch all the DOM elements by class name

Params:

NameTypeAttributeDescription
parent *
containerClassName String

Return:

Array

public static findFirstElementByTagName(parent: *, tagName: String): Object source

Fetch the first DOM element by tag name

Params:

NameTypeAttributeDescription
parent *
tagName String

Return:

Object

public static formatBoolean(val: *): * source

Takes in a boolean, returns a Yes or No

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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

Params:

NameTypeAttributeDescription
date Object

The date to format

formatString String

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:

NameTypeAttributeDescription
host *

Return:

*

public static getDateValue(dateStr: *, formatString: *): * source

Params:

NameTypeAttributeDescription
dateStr *
formatString *

Return:

*

public static getDomElementIndex(parent: *, child: *): * source

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
arr *

Return:

*

public static getMouseWheelDelta(evt: *): * source

get wheel delta value on occuring mouse event

Params:

NameTypeAttributeDescription
evt *

Return:

*

wheel data value

public static getNearestJSObject(target: *): * source

Returns nearest json object

Params:

NameTypeAttributeDescription
target *

Return:

*

public static getObjectProperty(data: *, property: *): * source

Returns property or subproperty (dot delimited) of an object

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
cell flexiciousNmsp.FlexDataGridCell
styleProp Object

Return:

*

public static getThemeById(themeID: *): * source

get theme by theme ID

Params:

NameTypeAttributeDescription
themeID *

Return:

*

public static getTopLevelApplication(): * source

Returns the top level application.

Return:

*

public static gradientFill(comp: *, colors: Array, paddingX: Number, paddingY: Number) source

Creates a gradient fill

Params:

NameTypeAttributeDescription
comp *
colors Array
paddingX Number
paddingY Number

public static handleError(event: *) source

Params:

NameTypeAttributeDescription
event *

public static hasLocalStorage(): boolean source

Return:

boolean

public static hasMethod(obj: *, prop: String): Boolean source

Returns true if method exists on the object specified.

Params:

NameTypeAttributeDescription
obj *
prop String

Return:

Boolean

public static hasMethodOrProperty(obj: *, prop: String): Boolean source

Returns true if method or property with name prop exists on the object specified.

Params:

NameTypeAttributeDescription
obj *
prop String

Return:

Boolean

public static isArray(input: *): * source

Returns true if passed in object is Array

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
grp *
col *

Return:

boolean

public static isCloneable(input: *): * source

Returns true if passed in object is clonable

Params:

NameTypeAttributeDescription
input *

Return:

*

public static isCompositeDataType(input: *): * source

Returns true if passed in object is Array or Object data type

Params:

NameTypeAttributeDescription
input *

Return:

*

public static isIE(): * source

check whether browser is internet explorer or not

Return:

*

public static isIE8(): * source

check whether browser is internet explorer 8.0 or not

Return:

*

public static isInUIHierarchy(child: *, parent: *): boolean source

Returns true if parent exists somwhere in the parent hierarchy of the child.

Params:

NameTypeAttributeDescription
child *
parent *

Return:

boolean

public static isMouseEvent(evt: *): Boolean source

check whether the event is a mouse event or not

Params:

NameTypeAttributeDescription
evt *

Return:

Boolean

returns true if it is mouse event othetwise false

public static isMoz(): * source

check whether browser is Mozila Firefox or not

Return:

*

public static isPrimitive(input: *): * source

Returns true if passed in object is a boolean, number or string

Params:

NameTypeAttributeDescription
input *

Return:

*

public static isSpecialDataType(input: *): * source

Returns true if passed in object is a undefined or null data types.

Params:

NameTypeAttributeDescription
input *

Return:

*

public static isStringNumeric(str: *): * source

Checks to see if the passed in value is a string representation of a numeric value

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
item *

the source object

column *

the DataGridColumn object. Its dataField property gets the property path with name

Return:

string

public static max(dataProvider: *, fld: *, comparisionType: *): * source

Returns the maximum value in the specified data provider

Params:

NameTypeAttributeDescription
dataProvider *
fld *
comparisionType *

Return:

*

public static mergeObjects(to: *, from: *) source

Merges the props of two objects.

Params:

NameTypeAttributeDescription
to *
from *

public static min(dataProvider: *, fld: *, comparisionType: *): * source

Returns the minimum value in the specified data provider

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
input Number

Return:

Number

public static numericCompare(a: *, b: *): * source

Compares two numeric values.

Params:

NameTypeAttributeDescription
a *

First number.

b *

Second number.

Return:

*

0 is both numbers are NaN. 1 if only a is a NaN. -1 if only b is a NaN. -1 if a is less than b. 1 if a is greater than b.

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

Params:

NameTypeAttributeDescription
a Number
b Number

Return:

Number

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:

NameTypeAttributeDescription
target *
firstSource *

Return:

*

public static offset(el: *): Object source

get offset values of an element

Params:

NameTypeAttributeDescription
el *

Return:

Object

return offset object contains top-left values

public static openBrowserPopup(url: *, options: *, useNew: *): * source

Opens a browser popup

Params:

NameTypeAttributeDescription
url *

The URL to open

options *
  • optional

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 *
  • optional

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

Params:

NameTypeAttributeDescription
arrayIn Array
pageIndex Number
pageSize Number

Return:

Array

public static pageArrayByPageNumbers(arrayIn: Array, pageIndexes: Array, pageSize: Number): Array source

returns array of pages by page number

Params:

NameTypeAttributeDescription
arrayIn Array
pageIndexes Array
pageSize Number

Return:

Array

public static parseXML(data: Object): Object source

convert data object to xml

Params:

NameTypeAttributeDescription
data Object

Return:

Object

return xml object

public static pasteToClipBoard(strToPaste: *) source

Pastes the passed in data to the clipboard.

Params:

NameTypeAttributeDescription
strToPaste *

public static positionComponent(relativeTo: *, itemToPosition: *, my: *, at: *, leftOffset: *, topOffset: *) source

Params:

NameTypeAttributeDescription
relativeTo *
itemToPosition *
my *
at *
leftOffset *
topOffset *

public static recursiveMatch(items: *, filter: *, grid: *, level: *, recursingExpression: *): boolean source

Params:

NameTypeAttributeDescription
items *
filter *
grid *
level *
recursingExpression *

Return:

boolean

public static removeAllChildren(parent: *) source

remove all children of the parent element

Params:

NameTypeAttributeDescription
parent *

public static removeChild(parent: *, child: *) source

remove child from parent element

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
domElement *
evt *
f Function

public static removeFromArray(array: *, itemToRemove: *): * source

Removes the supplied item from the supplied array, and returns that array

Params:

NameTypeAttributeDescription
array *

The array to remove the item from

itemToRemove *

The item to remove

Return:

*

public static removePopUp(popup: *) source

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
host *
expression *
valueToApply *
returnUndefinedIfPropertyNotFound *
applyNullValues *
valueApplier *

Return:

*

public static setHtml(elem: *, html: String) source

set html text to DOM element

Params:

NameTypeAttributeDescription
elem *
html String

public static setText(elem: *, text: String) source

set plain text to DOM element

Params:

NameTypeAttributeDescription
elem *
text String

public static setupInputMask(input: *, options: *) source

Params:

NameTypeAttributeDescription
input *
options *

public static setupWaterMark(input: *, options: *) source

Params:

NameTypeAttributeDescription
input *
options *

public static showConfirm(msg: *, parent: *, modal: *, title: *, features: *) source

A utility function that encapsulates the task of showing a confirmation popup.

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
errorMessage *

Text string that appears in the Alert control.

errorTitle *
  • optional

Text string that appears in the title bar.

public static showMessage(message: *, title: *, flag: *) source

Shows a popup with an informational message

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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

Params:

NameTypeAttributeDescription
arr Array
prop String
numeric Boolean

Return:

Array

returns sorted array

public static stringCompare(a: *, b: *, caseInsensitive: *): * source

Compares two String values.

Params:

NameTypeAttributeDescription
a *

First String value.

b *

Second String value.

caseInsensitive *

Specifies to perform a case insensitive compare, true, or not, false.

Return:

*

0 is both Strings are null. 1 if only a is null. -1 if only b is null. -1 if a precedes b. 1 if b precedes a.

public static stringToDate(valueString: String, inputFormat: String): * source

convert string to date object

Params:

NameTypeAttributeDescription
valueString String
inputFormat String

Return:

*

returns date object

public static sum(dataProvider: *, fld: *): * source

Returns the sum of all items the specified data provider

Params:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
host *

Return:

string

public static toStringSafe(host: *): string source

Returns the string value of the passed in object, or if null, returns an empty string.

Params:

NameTypeAttributeDescription
host *

Return:

string

public static traceData(obj: *) source

Params:

NameTypeAttributeDescription
obj *

public static xml2json(xml: *, tab: *, returnObject: *): Object | String source

convert xml to json string or data object

Params:

NameTypeAttributeDescription
xml *
tab *

add tab character

returnObject *

return as string or object

Return:

Object | String

returns json formatted data

Public Methods

public getClassNames(): string[] source

Returns a list of strings that represent the object hierarchy for this object.

Override:

TypedObject#getClassNames

Return:

string[]