Actuate JavaScript API classes : Class actuate.report.DataItem

Class actuate.report.DataItem

Description

A container for a data element in a report. DataItem provides functions to operate on a Data element, such as retrieving the data value and getting the HTML DOM element from the report data element.

Constructor

The object is constructed by report.PageContent.getDataItemByBookmark( ).

Function summary

Table 4-26 lists actuate.report.DataItem functions.

hide( )
show( )

actuate.report.DataItem.getBookmark

Syntax

string DataItem.getBookmark( )

Returns the bookmark name for this data item.

Returns

String.

Example

This example displays the data item’s bookmark in an alert box.

alert(myDataItem.getBookmark( ));

actuate.report.DataItem.getData

Syntax

string DataItem.getData( )

Returns the data value of this data element.

Returns

String.

Example

This example displays the data element’s data value in an alert box.

alert(myDataItem.getData( ));

actuate.report.DataItem.getHtmlDom

Syntax

HTMLElement DataItem.getHtmlDom( )

Returns the HTML element for this data item.

Returns

HTMLElement.

Example

This example displays the HTML DOM element for this data item inside a red border.

function showHtmlDom(myDataItem){
  var domNode = myDataItem.getHtmlDom( );
  var box = document.createElement('div');
  box.style.border = '2px solid red';
  var label = document.createElement('h2');
  label.innerHTML = 'The HTML DOM:';
  box.appendChild(label);
  box.appendChild(domNode);
  document.body.appendChild(box);
}

actuate.report.DataItem.getPageContent

Syntax

actuate.viewer.PageContent DataItem.getPageContent( )

Returns the page content to which this data item belongs.

Returns

actuate.report.PageContent. report content.

Example

This example displays the viewer ID of the page content in an alert box.

function showViewID(myDataItem){
  var pageContent = myDataItem.getPageContent( );
  var pageViewerID = pageContent.getViewerId( );
  alert (pageViewerID);
}

actuate.report.DataItem.getType

Syntax

string DataItem.getType( )

Returns the report element type of this object, which is data.

Returns

String. "Data"

Example

This example checks the report element type and displays an alert if the type is not "Data".

if (myDataItem.getType( ) != "Data"){
  alert("Type mismatch, report element type is not data")
}

actuate.report.DataItem.hide

Syntax

void DataItem.hide( )

Hides this element.

Example

Use hide( ) to hide a data item object, as shown in the following code:

myDataItem.hide( );

actuate.report.DataItem.show

Syntax

void DataItem.show( )

Shows this element.

Example

Use show( ) to reveal a hidden data item object, as shown in the following code:

myDataItem.show( );

actuate.report.DataItem.submit

Syntax

void DataItem.submit(function callback)

Submits all the asynchronous operations for this DataItem. Submit( ) triggers an AJAX request for all asynchronous operations. When the server finishes the processing, it returns a response and the results are rendered on the page in the DataItem container.

Parameters

callback

Function. The function to execute after the asynchronous call processing is done.

Example

Use submit( ) to execute changes on a data item object, as shown in the following code:

myDataItem.submit( );

(c) Copyright Actuate Corporation 2011