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 DataItem object is constructed by actuate.viewer.PageContent.getDataItemByBookmark( ).
Function summary
Table 4-27 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. The Data Value.
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.getInstanceId
Syntax
string DataItem.getInstanceId( )
Returns the instance id of this report element.
Returns
String. The instance id.
Example
This example displays the instance ID of the report element in an alert box:
function showID(myDataItem){
  var elementID = myDataItem.getInstanceId( );
  alert (elementID);
}
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( );

Additional Links:

Copyright Actuate Corporation 2012