UIElement

Class representing a UIElement in a Page.

Functions

# Detail Page (Canvas) Wizard

setVisibility()

Show or Hide a element

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('myElem')
elem.setVisibility(true);

# Detail Page (Canvas)

addToolTip(config)

Add tooltip for the element

Parameters:
Name Type Description
config object

configuration property for tooltip

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('myElem')
elem.addToolTip({text: 'Refrain from adding zeros'});

# Detail Page (Canvas)

removeToolTip()

Remove tooltip for the element

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('myElem')
elem.removeToolTip();

# Detail Page (Canvas)

addStyle(config)

Apply CSS styles for the element

Parameters:
Name Type Description
config Object

configuration property for element style

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('myElem')
elem.addStyle({'background-color': 'red', color: 'white', 'border-radius': '40px'})

# Detail Page (Canvas)

freeze(value)

Freezes the given element

Parameters:
Name Type Description
value Boolean

freeze property (true|false)

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('myElem')
elem.freeze(true);

# Detail Page (Canvas)

setReadOnly(value)

Removes write actions from the given related list

Parameters:
Name Type Description
value Boolean

readonly property (true|false)

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('myElem')
elem.setReadOnly(true);

# Detail Page (Canvas) Wizard

setContent(value)

Set text content for the text element

Parameters:
Name Type Description
value string

text content

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('txt1');
elem.setContent('Sorry! Text content changed.');

# Detail Page (Canvas)

setImage(value)

Set image for the image element

Parameters:
Name Type Description
value object

url of the image (or) userId

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('txt1');
elem.setImage({type : "url" , url : "https://www.example.com/image.jpeg"});
elem.setImage({type : "userId" , userId : "111222333444555"});

# Detail Page (Canvas)

setActive()

Set active tab in a container

Example

SampleCopycopied

var elem = ZDK.UI.getElementByID('tab1');
elem.setActive();