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 44‑27 lists actuate.report.DataItem functions.
Table 44‑27 actuate.report.DataItem functions
Function
Description
Returns the bookmark name for this data item
Returns the data value on this data element
Returns the HTML element for this data item
Returns the instance id of this report element.
Returns the page content to which this element belongs
Returns the report element type
hide( )
Hides this element
show( )
Shows this element
submit( )
Applies the changes made to this 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( ));
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( ));
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);
}
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);
}
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);
}
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");
}
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( );
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( );
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.
Parameter
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( );