Item (Class)
Item Class
An object of this class is created for each item on the screen.
Constructor
Item
()
Item Index
Methods
- addAction
- addBefore
- callActions
- callEachAction
- containsClass
- getBackgroundColor
- getDefaultValue
- getIconAbove
- getIconBelow
- getIconLeft
- getIconRight
- getImage
- getPosition This is only relevant when the item has been placed using `this.place()`;
- getSubTitle
- getText
- getTitle
- getVariable
- getVariableName
- hide
- init
- isAbove
- isBelow
- isFormItem
- isLeft
- isRight
- place
- setAction
- setBackgroundColor
- setBackgroundImage
- setHTML
- setImage
- setLabel
- setLabelColor
- setSubTitle
- setSubTitleColor
- setText
- setTextColor
- setTitle
- setTitleColor
- show
- swap
- toString
Properties
Methods
addAction
handler
Add an Action
for this Item
Parameters:
handler
...Stringhandler
is a function name or adhoc function.Items
can contain multiple actions. The AppBuilder defines only the default action.
Returns:
Returns this
.
addBefore
() ... Object
...
Returns:
Returns this
.
callActions
Name...
calls all actions for this Item
Parameters:
Name...
... String NumberDescribe... The default Action is set in AppBuilder. Additional Actions can be set using
app.addAction()
. Actions can be identified using theitemId
,DOM id
, and allClassnames
.
Returns:
Returns this
.
callEachAction
arr
Loops through arr
and calls the action for each element
Parameters:
arr
...StringDescribe...
Returns:
Returns this
.
containsClass
className
...
Parameters:
className
...StringDescribe...
Returns:
Returns true if this Item
contains the custom class className
getBackgroundColor
() ... Object
...
Returns:
Returns the backgroundColor
of this Item
.
getDefaultValue
() ... Object
...
Returns:
Return the Default Value
for this item.
getIconAbove
() ... Object
...
Returns:
returns the icon in the row above this icon
getIconBelow
() ... Object
...
Returns:
returns the icon in the row above this icon
getIconLeft
() ... Object
...
Returns:
returns the icon on the left of this icon
getIconRight
() ... Object
...
Returns:
returns the icon on the right of this icon
getImage
() ... Object
...
Returns:
returns the URL of the image for this item
getPosition
This is only relevant when the item has been placed using `this.place()`;
() ... Object
...
Returns:
Returns an object with the x,y coordinates of the item
getSubTitle
str
...
Parameters:
str
...StringDescribe...
Returns:
Returns the Subtitle
of the item
getText
str
...
Parameters:
str
...StringDescribe...
Returns:
Returns the Text
of the item
getTitle
str
...
Parameters:
str
...StringDescribe...
Returns:
Returns the Title
of the item
getVariable
() ... Object
...
Returns:
Returns app.getVariable()
if this Item is a Form Item
getVariableName
() ... Object
...
Returns:
Returns the variable name
if this is a Form Item
hide
() ... Object
Hide this Item
Returns:
Returns this
init
element
...
Parameters:
element
...StringDescribe...
Returns:
Returns this
.
isAbove
otherId
...
Parameters:
otherId
...NumberDescribe...
Returns:
returns true this item is above the other Item
isBelow
otherId
...
Parameters:
otherId
...NumberDescribe...
Returns:
returns true this item is below the other Item
isFormItem
Name...
...
Parameters:
Name...
... String NumberDescribe...
Returns:
Returns true
if this is a Form Item
isLeft
otherId
...
Parameters:
otherId
...NumberDescribe...
Returns:
returns true this item is left of the other Item
isRight
otherId
...
Parameters:
otherId
...NumberDescribe...
Returns:
returns true this item is right of the other Item
place
x
y
place the item at a certain absolute x,y position
Parameters:
x
...StringDescribe...
y
...StringDescribe...
Returns:
Returns this
.
setAction
handler
Sets the Action
for this Item
Parameters:
handler
... String Numberhandler
is a function name or adhoc function.
Returns:
Returns this
.
setBackgroundColor
color
set the background color of this Item to color
Parameters:
color
...StringSpecial case:
color
is'random'
will get a random color.
Returns:
Returns this
.
setBackgroundImage
src
method
Sets the backgroundImage
of this Item
to src
.
Parameters:
src
...StringDescribe...
method
...StringOptional
method
determines the layout. One of:fit
|fill
|stretch
|center
|tile
method
defaults tofit
Returns:
Returns this
.
setHTML
str
set the value of Html to str
Parameters:
str
...StringDescribe...
Returns:
Returns this
.
setImage
src
set the image URL to src
Parameters:
src
...StringDescribe...
Returns:
Returns this
.
setLabel
str
set the value of Label to str
Parameters:
str
...StringDescribe...
Returns:
Returns this
.
setLabelColor
color
set the color of Label to color
Parameters:
color
...StringDescribe...
Returns:
Returns this
.
setSubTitle
str
set the value of Sub Title to str
Parameters:
str
...StringDescribe...
Returns:
Returns this
.
setSubTitleColor
color
set the color of SubTitle to color
Parameters:
color
...StringDescribe...
Returns:
Returns this
.
setText
str
set the value of Text to str
Parameters:
str
...StringDescribe...
Returns:
Returns this
.
setTextColor
color
set the color of Text to color
Parameters:
color
...StringDescribe...
Returns:
Returns this
.
setTitle
str
set the value of Title to str
Parameters:
str
...StringDescribe...
Returns:
Returns this
.
Example:
paste example here
setTitleColor
color
set the color of Title to color
Parameters:
color
...StringDescribe...
Returns:
Returns this
.
show
() ... Object
Show this Item
Returns:
Returns this
.
swap
otherId
swaps this icon with the other
Parameters:
otherId
...NumberDescribe...
Returns:
Returns this
.
toString
Name...
...
Parameters:
Name...
... String NumberDescribe...
Returns:
returns a string representation of the object
Properties
id
Int
The id of the Item