Documentation

Javascript API

The Javascript API property provides access to TIK functionality from the client browser.

Custom Portlet store access
The custom portlet store allows you to read and write information from your portlet. 

Read Method

The read method allows you to read a key's value from the custom portlet store. The read method returns a jQuery promise object. This means that you will need to implement the methods to handle the result of the read method.

Syntax:

$.portlet.read(customPortletId, key)

Parameters:

Parameter Type Description
customPortletId int The id of the custom portlet to retrieve the data for
key string The key representing the object to retrieve

Return value:

Type Description
object A jQuery promise object for handle the result of the read call

Examples:

$.portlet.read(customPortletId, key)
.done(function(data) { //handle result of read });

Write Method

This method allows you to write data to the custom portlet store.

Syntax:

$.portlet.write(customPortletId, key, value)

Parameters:

Parameter Type Description
customPortletId int The customPortletId of the portlet to write a value for
key string The key to store the value for
value string The value to store

Return value:

Type Description
object A jQuery promise object for handle the result of the read call

Examples:

$.portlet.write(customPortletId, key, 'value')
    .done(function () { 
        //handle result of write
    });