PropertyEventMethodIndex
WebSquare.uiplugin.pivot - 5.0_4.4547B.20211124.201933

Pivot. Renders two-dimensional data. Renders data on two axes with statistics. Supports statistical values such as Sum, Avg, Count, Minimum, and Maximum. The developer can also customize statistical values using user-defined functions. Provides similar features to the pivotTable of Excel. (Browsers supported: IE10 or higher versions.)

Type

uiplugin

Property Summary

aggregatorName
[default:Sum] Sets the default aggregator (to get the statistical data). The aggregator in the field is of a higher priority. If there is no aggregator defined in the field, the default aggregator will be used.
allTotalName
Label of the grand total
autoFit
[lastColumn, allColumn] Automatically fits the table to the browser width. As a result, no horizontal scrolling will be made.<br />allColumn is to evenly distribute the columns, and lastColumn is to use only the last column to fit to the browser width.
autoFitMinWidth
Specify the minimum width of the pivot (in px). Valid when the autoFit is allColumn.
autoPopupInvalidMessage
Automatically pops up the warning message upon a key input not defined in the regExp.
bodyTextAlign
[default:center, left, right] Text alignment of the body not including the header
chartDataSeperator
x and y data label separator for the chart data. [default: '-']
chartLegendSeperator
Label separator for the chart data. [default: '-']
class
Same as the class property in HTML. The class defined in the CSS file or style block can be applied. Multiple classes can be defined with being divided by blank space.
cols
Sets the columns on the column axis for the initial display. Specify the column IDs using the comma as the delimiter.
dataList
DataList ID to bind with the Pivot
decimalSep
Decimal point separator.
digitsAfterDecimal
Number of the digits after the decimal point.
excludeHiddenList
Columns to exclude from the hiddenList of the header.
grandTotalDisplayType
Selects where to display the grand total.
grandTotalName
Label of the header values
headerListOrder
Header sequence.
headerTextAlign
[default:center, left, right] Text alignment of the header
hiddenHeaderList
List of the headers to hide.
id
Component ID
invalidMessage
Message to display upon a failure by the validate API. Valid only in case of displaymessage="true".
noColumnMove
Supports dragging of the header column in the pivot data area.
noResultMessage
Message to be displayed when there is no search result in the pivot.
noResultMessageClass
Class of the no-result message in the pivot.
noResultMessageStyle
Style of the no-result message in the pivot.
noResultMessageVisible
Display of the message when there is no search result in the pivot.
prefix
Prefix to be palced before the data.
rows
Define the columns on the row axis for the initial Pivot display. Specify the column IDs using the comma as the delimiter.
scaler
Scaler.
showGrandTotal
Shows the sum.
showZero
Shows 0 when there is no data.
sortFunction
Name of the function that sorts the data on rows, cols, and vals axes based on the received column IDs.
suffix
Suffix to be placed after the data.
textAlign
[default:center, left, right] Text alignment
thousandsSep
Separator for every 3 digits.
totalTextAlign
[default:center, left, right] Text alignment of the entire pivot.
useNumberFormat
Uses a user-defined number format.
userData1
User-defined property
userData2
User-defined property
userData3
User-defined property
vals
Define the columns on the value axis for the initial Pivot display. Specify the column IDs using the comma as the delimiter.
valuesAxis
[default:row] Location of the Σ label (to be created when there are multiple columns on the value axis)

Event Summary

oncellclick
Triggered upon the end user's clicking the cell.
onrefresh
Triggered when a Pivot setting is dynamically changed (such as axis moving, aggregator changing, or exclusion changing.)

Method Summary

addClass( className )
Adds a CSS class to the component.
bind( eventType , function )
Dynamically allocate an event and the handler function to the component.
changeClass( oldClassName , newClassName )
Changes the class currently applied to the corresponding WebSquare component. (Supported in all WebSquare components.)
focus( )
Focuses the WebSquare component.
getDisabled( )
Returns the current value of the disabled property.
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself.
getID( )
Returns the ID of the WebSquare component.
getInitStyle( CSS )
Returns the initial style of the WebSquare component.
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
getPluginName( )
Returns the name of the WebSquare component.
getPosition( positionName )
Returns the position (left and top) of the WebSquare component. (Supported in all WebSquare components.)
getReadOnly( )
Returns the current value of the readOnly property.
getScope( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
getScopeWindow( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
getSize( sizeName )
Sets the size (width and height) of the WebSquare component. (Supported in all WebSquare components.)
getStyle( propertyName )
Returns the CSS setting of the WebSquare component.
getStyleValue( style )
[deprecated]
getTitle( )
Returns the title of the WebSquare component.
getTotalRow( )
Gets the total number of the rows.
getUdcHome( )
Returns the path of the UDC file including the file name in which the UDC object is defined. (Supported in all WebSquare components.)
getUdcRoot( )
Returns the path of the UDC file in which the UDC object is defined. (Supported in all WebSquare components.)
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file.
hasClass( className )
Checks whether the WebSquare component has a certain class.
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
pivotCSVDownload( options )
Saves the data as a CSV file.
pivotCSVUpload( options )
Upload CSV data to the pivot.
pivotExcelDownload( options , infoArr )
Downloads the pivot data into an Excel file.
removeClass( className )
Removes a class from the WebSquare component. (Supported in all WebSquare components.)
setDisabled( disabled )
Sets the disabled property of the WebSquare component.
setEventPause( evList , flag )
Pauses the event.
setFixedColumn( fixedColNum )
Fixes the column.
setFixedRow( fixedRow )
Fixes the column.
setInitStyle( property )
Restores the initial style of the WebSquare component.
setOpacity( value )
Sets the opacity in the WebSquare component. (Supported in all WebSquare components.)
setPivotInit( valsStr )
Sets the vals area for the pivot, and renders the Pivot again.
setPosition( left , top , mode )
Sets the position (left, top) of the WebSquare component.
setReadOnly( readOnly )
Sets the readOnly proprety of the WebSquare component.
setSize( width , height )
Sets the size (width, height) of the WebSquare component.
setStyle( propertyName , value )
Sets the CSS of the WebSquare component.
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
setvals( valsStr )
Sets the vals area for the pivot, and renders the Pivot again.
show( displayType )
Shows the WebSquare component on the page. (Supported in all WebSquare components.)
toggleClass( className )
Adds or removes a CSS class to or from a WebSquare component. (Supported in all WebSquare components.)
trigger( type , array )
Triggers the specified event in the WebSquare component.
unbind( type , function )
Removes the specified event from the WebSquare component.
visible( flag )
[deprecated]

Property Detail

aggregatorName
[default:Sum] Sets the default aggregator (to get the statistical data). The aggregator in the field is of a higher priority. If there is no aggregator defined in the field, the default aggregator will be used.
Aggregators include Sum, Average, Count, Minimum, Maximum, and others to be customized.
allTotalName
Label of the grand total
autoFit
[lastColumn, allColumn] Automatically fits the table to the browser width. As a result, no horizontal scrolling will be made.<br />allColumn is to evenly distribute the columns, and lastColumn is to use only the last column to fit to the browser width.
allColumn adjusts widths of all columns by evenly distributing blank space to all columns while lastColumn adjusts only the width of the last column.
autoFitMinWidth
Specify the minimum width of the pivot (in px). Valid when the autoFit is allColumn.
autoPopupInvalidMessage
Automatically pops up the warning message upon a key input not defined in the regExp.
bodyTextAlign
[default:center, left, right] Text alignment of the body not including the header.
chartDataSeperator
x and y data label separator for the chart data. [default: '-']
chartLegendSeperator
Label separator for the chart data. [default: '-']
class
Same as the class property in HTML. The class defined in the CSS file or style block can be applied. Multiple classes can be defined with being divided by blank space.
WebSquare5 Engine applies different classes to different components. By defining a common class, the common class can be applied to multiple components.
cols
Sets the columns on the column axis for the initial display. Specify the column IDs using the comma as the delimiter.
The final shape of the table depends on the sequence of the column IDs.
(ex1) cols="col3,col4,col5" (ex2) cols="col5,col3,col4"
dataList
DataList ID to bind with the Pivot
decimalSep
Decimal point separator. Valid when useNumberFormat is true.
digitsAfterDecimal
Number of the digits after the decimal point. Valid when useNumberFormat is true.
excludeHiddenList
Columns to exclude from the hiddenList of the header.
grandTotalDisplayType
Selects where to display the grand total. [default: both, vertical, horizontal] (Options) "both" (Default): Display on the lower and the left parts of the table. "vertical" : Display on the right. "horizontal" : Displays on the lower part.
grandTotalName
Label of the header values
headerListOrder
Header sequence.
headerTextAlign
[default:center, left, right] Text alignment of the header.
hiddenHeaderList
List of the headers to hide.
id
Component ID
The component ID is allocated as a global object. The script can access each object through the component ID.
invalidMessage
Message to display upon a failure by the validate API. Valid only in case of displaymessage="true".
Cannot be used with the invalidMessageFunc property at the same time. (Related API) validate(); displaymessage="true" Cannot be used with the invalidMessageFunc property at the same time.
noColumnMove
Supports dragging of the header column in the pivot data area.
noResultMessage
Message to be displayed when there is no search result in the pivot.
noResultMessageClass
Class of the no-result message in the pivot.
noResultMessageStyle
Style of the no-result message in the pivot.
noResultMessageVisible
Display of the message when there is no search result in the pivot.
prefix
Prefix to be palced before the data. Valid when useNumberFormat is true.
rows
Define the columns on the row axis for the initial Pivot display. Specify the column IDs using the comma as the delimiter.
The final shape of the table depends on the sequence of the column IDs.
(ex1) rows="col1,col2" (ex2) rows="col2,col1"
scaler
Scaler. Valid when useNumberFormat is true.
showGrandTotal
Shows the sum.
showZero
Shows 0 when there is no data. Valid when useNumberFormat is true.
sortFunction
Name of the function that sorts the data on rows, cols, and vals axes based on the received column IDs.
The developer can also define the data sequence using the sortOrder property of each field.
The sortFunciton is prior to the sortOrder property.
suffix
Suffix to be placed after the data. Valid when useNumberFormat is true.
textAlign
[default:center, left, right] Text alignment.
thousandsSep
Separator for every 3 digits. Valid when useNumberFormat is true.
totalTextAlign
[default:center, left, right] Text alignment of the entire pivot.
useNumberFormat
Uses a user-defined number format. (digitsAfterDecimal, scaler, showZero, decimalSep, thousandsSep, prefix, suffix)
userData1
User-defined property. Use getUserData("userData3") to get the data. // Example getUserData("userData1");
userData2
User-defined property. Use getUserData("userData2") to get the data. // Example getUserData("userData2");
userData3
User-defined property. Use getUserData("userData3") to get the data. // Example getUserData("userData3");
vals
Define the columns on the value axis for the initial Pivot display. Specify the column IDs using the comma as the delimiter.
If multiple columns are set, the Σ label will be created.
The final shape of the table depends on the sequence of the column IDs.
(ex1) vals="col6,col7" (ex2) cols="col5,col3,col4"
valuesAxis
[default:row] Location of the Σ label (to be created when there are multiple columns on the value axis)

Event Detail

oncellclick
Triggered upon the end user's clicking the cell.
Parameter
nametypedescription
infoObjectReturns an obejct including rowIndex, colIndex, and rowData. <Number> info.rowIndex : Row index of the event-triggered cell <Number> info.colIndex : Column index of the event-triggered cell <String> info.rowData : Cell data array for the row index of the event-triggered cell
onrefresh
Triggered when a Pivot setting is dynamically changed (such as axis moving, aggregator changing, or exclusion changing.)
Parameter
nametypedescription
optionsJSONoptions (rows, cols, vals, etc.) object of the Pivot

Method Detail

addClass( className )
Adds a CSS class to the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
classNameStringYName of the class to add
Sample
// (Example) // Add oddClass to input1 component. input1.addClass("oddClass");
bind( eventType , function )
Dynamically allocate an event and the handler function to the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
eventTypeStringYEvent to allocate
functionFunctionYHandler function of the event
Sample
// (Example 1) // Define a function for the onclick event of input1. input1.bind("onclick", function(e){ alert(input1.getValue();})); // (Example 2) // Define commObj.ev_click function in advance. var commObj = {}; commObj.ev_click = function(e){ alert("click :: "+this.id); }; // Dynamically allocate onclick event and the handler function to input1 component. input1.bind("onclick", commObj.ev_click );
changeClass( oldClassName , newClassName )
Changes the class currently applied to the corresponding WebSquare component. (Supported in all WebSquare components.)
Only the classes added by addClass can be changed.
In order to remove classes directly defined in the class propert of the WebSquare component, add the following in config.xml. // Add the following in config.xml.
Parameter
nametyperequireddescription
oldClassNameStringYClass to change
newClassNameStringYClass to newly use
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following in config.xml. <style> <removeDefaultClass value="true" /> </style> // Change the class. // Change tmpInputClass class to tmpInputWarninClass. input1.changeClass("tmpInputClass","tmpInputWarninClass");
focus( )
Focuses the WebSquare component. (Supported in all WebSquare components.)
getDisabled( )
Returns the current value of the disabled property. (Supported in all WebSquare components.)
Return
typedescription
BooleanValue of the disabled property
Sample
// (Example) Check the current value of the disabled property. var returnValue = componentId.getDisabled(); // (Return Example) false
getGenerator( )
In case generated by the Generator component, returns the parent Generator object that created the component itself. (Supported in all WebSquare components.)
Return
typedescription
ObjectParent Generator object
Sample
// (Example) The Generator (parent) create a Trigger (child). <w2:generator id="generator1"> <w2:trigger id="trigger1" ev:onclick="scwin.trigger1_onclick"></w2:trigger></w2:generator> // In the example below, upon the end user’s clicking the Trigger 1, the generator1 object will be displayed on the console. scwin.trigger1.onclick = function(){ console.log(this.getGenerator());}
getID( )
Returns the ID of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringWebSquare component ID
Sample
// Upon dynamically receiving a WebSquare component, the ID can be checked as shown below. function fn_validCheck(tmpObj){ var compID = tmpObj.getID(); } // If the tmpObj in the above example has "input1" ID. // (Return) "input1"
getInitStyle( CSS )
Returns the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
CSSStringNProperty (If not specified, all properties will be displayed.)
getOpacity( )
Returns the opacity of the WebSquare component. (Supported in all WebSquare components.)
The Engine returns the opacity value of the CSS.
Return
typedescription
IntegerOpacity
Sample
// Apply the opacity CSS to the InputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;opacity:0.2;"></xf:input> // Return the opacity of the InputBox. var returnValue = input1.getOpacity(); // A real number between 0 and 1 will be returned. // (Return) "0.2"
getOriginalID( )
Returns the originalID of the WebSquare component. (Supported in all WebSquare components.)
The originalID is valid when the scope function is in use.
For scope="true" WFrame, component IDs inside the WFrame is changed with the prefix(wframeID + "_") being added before the ID given by the user (originalID).
The originalID means the ID before the prefix being added.
Return
typedescription
StringoriginalID of the component
Sample
// An example of multi-WFrame page // Main page with a WFrame (main.xml) <w2:wframe id="wframe1" src="text.xml" scope="true"/> // Source page to be contained in the WFrame (text.xml) <w2:textbox id="textbox1"/> // (Example) Check the Id and the original ID in the script of text.xml // Run getID. textbox1.getID(); // "wframe1_textbox1" is returned. // Run getOriginalID. textbox1.getOriginalID(); // "textbox1" is returned.
getPluginName( )
Returns the name of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringName of the WebSquare component (pluginName)
Sample
// When a common function dynamically receives a WebSQuare object as shown below, different actions can be made for each component type. var commObj = {}; commObj.fn_makeReqData = function(tmpObj){ var tmpID = tmpObj.getID(); // Component ID var tmpCompType = tmpObj.getPluginName(); // Component name if(tmpCompType == "input"){ //..Logic.. }else if(tmpCompType == "gridView"){ //..Logic .. }else{ //..Logic.. } };
getPosition( positionName )
Returns the position (left and top) of the WebSquare component. (Supported in all WebSquare components.)
When the position is set in 0%, the value will be converted into %.
Parameter
nametyperequireddescription
positionNameStringY[left, top] Position type
Return
typedescription
NumberPosition of the component
Sample
// CSS margin is applied to the Input component as shown below. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;margin:10px;"></xf:input> // (Example) Check the top value of the InputBox. var returnValue = input1.getPosition("top"); // Position value in pixels will be returned. // (Return) 10
getReadOnly( )
Returns the current value of the readOnly property. (Supported in all WebSquare components.)
Return
typedescription
BooleanThe current setting of the readOnly property
Sample
// Example to check the readOnly setting of the component. var returnValue = componentId.getReadOnly(); // (Return Example) false
getScope( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
For scope="true" WFrame, null will be returned.
Return
typedescription
ObjectWFrame object or null
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. textbox1.getScope(); // (Return Example) wframe11 object
getScopeWindow( )
For the child component of a scope="true" WFrame, returns the parent WFrame object. (Supported in all WebSquare components.)
If not a child of a scope="true" WFrame, a global window object will be returned.
Return
typedescription
ObjectScope object of the WFrame or a global window object
Sample
// (Example) // The main page has wframe1 which contains wframe1 which also contains wframe11. // The source page of wframe11 has textbox1. var scope = textbox1.getScopeWindow(); scope.wframe11 === textbox1.getScope(); // true
getSize( sizeName )
Sets the size (width and height) of the WebSquare component. (Supported in all WebSquare components.)
If set in %, values will be converted into pixels.
Parameter
nametyperequireddescription
sizeNameStringYSize types. For calculation of each size type, see the below:
height : element.clientHeight innerHeight : element.clientHeight + padding outerHeight : element.clientHeight + padding + border outerMarginHeight : element.clientHeight + padding + border + margin width : element.clientWidth innerWidth : element.clientWidth + padding outerWidth : element.clientWidth + padding + border outerMarginWidth : element.clientWidth + padding + border + margin
Return
typedescription
NumberSize of the component
Sample
var returnValue = componentId.getSize("width"); // (Return Example) 100 // Values are in pixels. // If set in %, values will be converted into pixels.
getStyle( propertyName )
Returns the CSS setting of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyNameStringYCSS property to return
Return
typedescription
StringCSS value
Sample
// Define an Input component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;"></xf:input> // (Example) Check the width of the InputBox above. var returnValue = input1.getStyle("width"); // (Return) "144px"
getStyleValue( style )
[deprecated]
Use getStyle instead.
Returns the current CSS applied to the WebSquare component.
Parameter
nametyperequireddescription
styleStringYCSS property to return
Return
typedescription
StringCSS value (Colors are returned in HexCode.)
getTitle( )
Returns the title of the WebSquare component. (Supported in all WebSquare components.)
Return
typedescription
StringTitle
Sample
// In the following example, the Title is “Input Name”. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" title="이름 입력"></xf:input> var tmpTitle = input1.getTitle(); // (Return Example) “Enter your name.”
getTotalRow( )
Gets the total number of the rows.
Return
typedescription
NumberTotal number of the rows
getUdcHome( )
Returns the path of the UDC file including the file name in which the UDC object is defined. (Supported in all WebSquare components.)
The file name includes .xml. In order to get the file path without .xml, use getUdcRoot.
When called by a WebSquare component, not a UDC object, “undefined” will be returned.
Return
typedescription
StringUDC file path (For others than the UDC, undefined will be returned.)
Sample
// Example // UDC file path is /a/b/udc.xml. // Page XML is /a/c/main.xml. // UDC ID is udc1. udc1.getUdcHome(); // (Result) /a/b/udc.xml
getUdcRoot( )
Returns the path of the UDC file in which the UDC object is defined. (Supported in all WebSquare components.)
Not contains the file name. In order to get a path including the file name, use getUdcHome.
When called by a WebSquare component, not a UDC object, “undefined” will be returned.
Return
typedescription
StringUDC file path (For others than the UDC, undefined will be returned.)
Sample
// Example // UDC file path is /a/b/udc.xml. // Page XML is /a/c/main.xml. // UDC ID is udc1. udc1.getUdcHome(); // (Execution Result) /a/b/
getUserData( key )
Returns the value set by setUserData or directly defined by the user in the XML file. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
keyStringYData key
Return
typedescription
StringValue for the given key
Sample
// (Example) Setting the user property (setTest) in the InputBox <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" setTest="Hello"></xf:input> // Returns the value of the setTest property. input1.getUserData("setTest"); // (Return) "Hello" // Set 'valueTest' (key) and 'WebSquare' (data) through setUserData. input1.setUserData("valueTest","WebSquare"); // Returns the value of the setTest property. input1.getUserData("WebSquare"); // (Return) "WebSquare"
hasClass( className )
Checks whether the WebSquare component has a certain class. (Supported in all WebSQuare components.)
Parameter
nametyperequireddescription
classNameStringYName of the class to check
Return
typedescription
BooleanWhether the class exists or not
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> var returnValue = input1.hasClass("tmpInputClass"); // (Return) true
hide( )
Hides the WebSquare component. (Supported in all WebSquare components.)
display:none; or visibility:hidden; CSS is applied.
Sample
// (Example) Hide the component. componentId.hide();
pivotCSVDownload( options )
Saves the data as a CSV file. (Supported for JDK 1.5 or higher.)
Parameter
nametyperequireddescription
optionsJSONYCSV download options in JSON format
<String:N> options.fileName [default: csvfile.csv] Default file name upon displaying of the file selection dialog <String:N> options.delim [default: ';'] Data delimiter <String:N> options.useHeaderX [default: false] Saving of the headerX including the axis (true is to save, and false is not to save.) <String:N> options.useHeaderY [default: false] Saving of the headerY including the axis (true is to save, and false is not to save.) <String:N> options.useTotal : Displays the total in the downloaded file. [default: true] ("true" is to display, and "false" is not to display). In case the grandTotalDisplayType property is set, the grandTotalDisplayType property will be applied.
Sample
// Specify columns to save. var colArr = []; colArr[0] = "name"; colArr[1] = "corp"; // Download options var options = { fileName: "saveCSV.csv", delim: ";" }; pivotTable.pivotCSVDownload(options); // In case of no option, an empty object must be given as a parameter. pivotTable.pivotCSVDownload({});
pivotCSVUpload( options )
Upload CSV data to the pivot. (Supported for JDK 1.5 or higher.)
Parameter
nametyperequireddescription
optionsJSONYCSV uploading option in JSON format
<String:N> options.delim [default: ','] Data delimiter in the CSV file <String:N> options.escapeChar Characters to remove from the CSV data ( ex) '\'' <Number:N> options.startRowIndex [default: 0] Row index from which the data starts for the pivot. Once the startRowIndex is specified, the header setting will be ignored. <String:N> options.skipSpace [default: 0, 1] Space skipping (1 is to skip, and 0 is to include.) <String:N> options.append [default: 0, 1] Appending of the CSV file data to the pivot (1 is to append, and 0 is to delete the existing pivot data and insert.) <String:N> options.popupUrl URL of the popup to be called upon uploading
Sample
var options = { delim: ",", escapeChar: "'", startRowIndex: 1 }; pivotTable.pivotCSVUpload(options); // In case of no option, an empty object must be given as a parameter. pivotTable.pivotCSVUpload({});
pivotExcelDownload( options , infoArr )
Downloads the pivot data into an Excel file. (Supported for JDK 1.5 or higher.)
Parameter
nametyperequireddescription
optionsObjectYExcel download options
<String:Y> options.fileName : [default: excel.xls] Name of the file to download. Required. <String:N> options.sheetName : [default: sheet] Name of the Excel sheet <Number:N> options.startRowIndex : [default: 0] Row index from which the pivot data starts (including the header) <Number:N> options.startColumnIndex : [default: 0] Column index from which the pivot data starts (including the header) <String:N> options.axisLColor : [default: #FFFFFF] Color of the upper-left axis area <String:N> options.axisLFontName : [default: N/A] Font in the upper-left axis area <String:N> options.axisLFontSize : [default: 10] Font size in the upper-left axis area <String:N> options.axisLFontColor : [default: N/A] Font color in the upper-left axis area <String:N> options.axisLFontWeight : [default: N/A] Font weight of the upper-left axis in the Excel file (Example: "bold") <String:N> options.axisLTextAlign : [default: N/A] Alignment in the upper-left axis ("center", "right", "left") <String:N> options.axisRColor : [default: #FFFFFF] Color of the upper-right axis <String:N> options.axisRFontName : [default: N/A] Font of the upper-right axis <String:N> options.axisRFontSize : [default: 10] Font size of the upper-right axis <String:N> options.axisRFontColor : [default: N/A] Font color of the upper-right axis <String:N> options.axisRFontWeight : [default: N/A] Weight of the upper-right axis (Example: "bold"); <String:N> options.axisRTextAlign : [default: N/A] Alignment of the upper-right axis ("center", "right", "left") <String:N> options.axisBColor : [default: #FFFFFF] Color of lower and upper axes <String:N> options.axisBFontName : [default: N/A] Font name of lower and upper axes <String:N> options.axisBFontSize : [default: 10] Font size of lower and upper axes <String:N> options.axisBFontColor : [default: N/A] Font color of lower and upper axes <String:N> options.axisBFontWeight : [default: N/A] Weight of lower and upper axes (Example: "bold"); <String:N> options.axisBTextAlign : [default: N/A] Alignment of lower and upper axes ("center", "right", "left") <String:N> options.headerXColor : [default: #FFFFFF] Color of the upper header <String:N> options.headerXFontName : [default: N/A] Font name of the upper header <String:N> options.headerXFontSize : [default: 10] Font size of the upper header <String:N> options.headerXFontColor : [default: N/A] Font color of the upper header <String:N> options.headerXFontWeight : [default: N/A] Weight of the upper header (Example: "bold"); <String:N> options.headerXTextAlign : [default: N/A] Alignment of the upper header ("center", "right", "left") <String:N> options.headerXWidth : [default: N/A] Width of the upper header column <String:N> options.headerYColor : [default: #FFFFFF] Color of the left axis <String:N> options.headerYFontName : [default: N/A] Font name of the left axis <String:N> options.headerYFontSize : [default: 10] Font size of the left axis <String:N> options.headerYFontColor : [default: N/A] Font color of the left axis <String:N> options.headerYFontWeight : [default: N/A] Weight of the left axis (Example: "bold") <String:N> options.headerYTextAlign : [default: N/A] Alignment of the left axis ("center", "right", "left") <String:N> options.headerYWidth : [default: N/A] Width of the left-axis column <String:N> options.totalXColor : [default: #FFFFFF] Color of the Total section in the upper header <String:N> options.totalXFontName : [default: N/A] Font name of the Total section in the upper header <String:N> options.totalXFontSize : [default: 10] Font size of the Total section in the upper header <String:N> options.totalXFontColor : [default: N/A] Font color of the Total section in the upper header <String:N> options.totalXFontWeight : [default: N/A] Weight of the Total section in the upper header (Example: "bold") <String:N> options.totalXTextAlign : [default: N/A] Alignment of the Total section in the upper header ("center", "right", "left") <String:N> options.totalXWidth : [default: N/A] Width of the Total section in the upper header <String:N> options.totalYColor : [default: #FFFFFF] Color of the Total section on the left axis <String:N> options.totalYFontName : [default: N/A] Font name of the Total section on the left axis <String:N> options.totalYFontSize : [default: 10] Font size of the Total section on the left axis <String:N> options.totalYFontColor : [default: N/A] Font color of the Total section on the left axis <String:N> options.totalYFontWeight : [default: N/A] Weight of the Total section on the left axis (Example: "bold") <String:N> options.totalYTextAlign : [default: N/A] Alignment of the Total section on the left axis ("center", "right", "left") <String:N> options.totalYFormat : [default: N/A] Format of the Total section on the left axis (Example: #,###) <String:N> options.totalYWidth : [default: N/A] Width of the Total section on the left axis <String:N> options.bodyColor : [default: #FFFFFF] Color of the body area <String:N> options.bodyFontName : [default: N/A] Font name of the body area <String:N> options.bodyFontSize : [default: 10] Font size of the body area <String:N> options.bodyFontColor : [default: N/A] Font color of the body area <String:N> options.bodyFontWeight : [default: N/A] Weight of the body area (Example: "bold") <String:N> options.bodyTextAlign : [default: N/A] Alignment of the body area ("center", "right", "left") <String:N> options.bodyFormat : [default: N/A] Format of the body area (Example: #,##0.00) <String:N> options.bodyWidth : [default: N/A] Width of the column in the body area <String:N> options.bodyDefaultValue : [default: N/A] Default value for the body columns <String:N> options.sumColor : [default: #FFFFFF] Color of the Total section in the body area <String:N> options.sumFontName : [default: N/A] Font name of the Total section in the body area <String:N> options.sumFontSize : [default: 10] Font size of the Total section in the body area <String:N> options.sumFontColor : [default: N/A] Font color of the Total section in the body area <String:N> options.sumFontWeight : [default: N/A] Weight of the Total section in the body area (Example: "bold") <String:N> options.sumTextAlign : [default: N/A] Alignment of the Total section in the body area ("center", "right", "left") <String:N> options.sumFormat : [default: N/A] Format of the Total section in the body area (Example: #,###) <String:N> options.sumWidth : [default: N/A] Width of the column in the body area <Boolean:N> options.showProcess : [default: true] Whether to show the process window or not during the downloading. <Boolean:N> options.bodyWordwrap : [default: false] Changes the line in the body. <String:N> options.useHeaderX : [default: true] Display of the upper header upon download ("true" is to display, and "false" is not to display.) <String:N> options.useHeaderX : [default: true] Display of the upper header upon download ("true" is to display, and "false" is not to display.) <String:N> options.headerYMerge : [default: false] Whether to merge the left column when the left column has the same data. <String:N> options.useTotal : Displays the total in the downloaded file. [default: true] ("true" is to display, and "false" is not to display). In case the grandTotalDisplayType property is set, the grandTotalDisplayType property will be applied. <String:N> options.separator : [default: ,] Data separator required for data transmission to the server. The default is comma. <String:N> options.freezePane : [default: ""] Coordinates and coordinate offset to freeze the pane (Example) freezePane="3,4" Fix to 3 on X and 4 on Y. freezePane="0,1,0,5" Fix to 0 on X and 5 on Y from 0 on X and 1 on Y. <String:N> options.autoSizeColumn : [default: false] Whether to automatically adjust the width or not. <String:N> options.displayGridlines : [default: false] Whether to display gridline on the Excel sheet. <String:N> options.useDataFormat : [default: “”] "true" is to display the data format on the Excel file according to the dataType. dataType="text" will display “text”, and dataType="number" or "bigDecimal" will display according to the bodyFormat. (Example: bodyFormat="#,##0.00") <String:N> options.optionParam : [default: N/A] Data to send for the DRM interface. (Use (String)request.getAttribute("optionParam") from the server.) <Object:N> options.printSet Printer setting in JSON format <String:N> options.printSet.fitToPage : [default: false] Page fitting option for printing of the Excel file. <String:N> options.printSet.landScape : [default: false] Landscape direction option for printing of the Excel file. <String:N> options.printSet.fitWidth : [default: 1] Page width <String:N> options.printSet.fitHeight : [default: 1] Page height <String:N> options.printSet.scale : [default: 100] Scaling ratio for printing. fitToPage must be false. <String:N> options.printSet.pageSize : [default: A4] Printing options for Excel ( ex) "A3", "A4", "A5", "B4" )
infoArrObjectNArray of pivot data for another cell
<Number:N> infoArr.rowIndex : Row index to display text <Number:N> infoArr.colIndex : Column index to display contents <Number:N> infoArr.rowSpan : Number of the rows to merge <Number:N> infoArr.colSpan : Number of the columns to merge <String:N> infoArr.text : Text to display <String:N> infoArr.textAlign : Alignment (left, center, right) <String:N> infoArr.fontSize : font size (Example) "20px" <String:N> infoArr.fontName : font name <String:N> infoArr.color : font color (Example) "red" <String:N> infoArr.fontWeight : font weight (Example) "bold" <String:N> infoArr.drawBorder : cell border (Example) true <String:N> infoArr.wordWrap : Line change in the cell (Example) "true" <String:N> infoArr.bgColor : Background color of the cell (Example) "red"
Sample
// Download as an Excel without options specified options. var excelOpt = {}; // Downloading options for the Excel file excelOpt.fileName = "excelData.xls"; // The extension "xlsx" can be also used. pivotTable.pivotExcelDownload( excelOpt );
removeClass( className )
Removes a class from the WebSquare component. (Supported in all WebSquare components.)
Only the classes added by addClass can be removed.
In order to remove classes directly defined as a property of the component, add the following in config.xml. // Add the following in config.xml. <style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYName of the class to remove
Sample
// If the class is directly defined as an InputBox property. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // In the config.xml file, add the following. <style> <removeDefaultClass value="true" /> </style> // Classes can be removed by removeClass. input1.removeClass("tmpInputClass");
setDisabled( disabled )
Sets the disabled property of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
disabledBooleanYDisabled status
true: Disabled. false: Not disabled.
Sample
// Sets the disabled property in the component. componentId.setDisabled(true);
setEventPause( evList , flag )
Pauses the event. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
evListStringNList of the events to pause. (in case of null, all events of the corresponding WebSquare component is paused or restarted.)
flagBooleanYWhether to pause the event or not.
true: Pause. false: Not pause.
Sample
// (Example 1) // Pause the onclick event. input1.setEventPause("onclick", true); // (Example 2) // Restart the onfocus and the onblur events. input1.setEventPause("onfocus,onblur", false); // (Example 3) // Pause all events registered in input1. input1.setEventPause(null, true);
setFixedColumn( fixedColNum )
Fixes the column.
Parameter
nametyperequireddescription
fixedColNumNumberYThe number of the columns to fix from the far left.
Sample
// Fix the first two columns. pivot1.setFixedColumn(1);
setFixedRow( fixedRow )
Fixes the column.
Parameter
nametyperequireddescription
fixedRowNumberYThe number of the columns to fix from the far left.
Sample
// Fix first two rows. pivot1.setFixedRow(1);
setInitStyle( property )
Restores the initial style of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyStringNCSS property (If not spcified, all properties will be restored.)
Sample
// (Example) group1.setInitStyle();
setOpacity( value )
Sets the opacity in the WebSquare component. (Supported in all WebSquare components.)
The engine sets the opacity property (of CSS).
Parameter
nametyperequireddescription
valueNumberYOpacity (Real number between 0 and 1)
Sample
// (Example) Set the opacity as 0.45. componentId.setOpacity(0.45);
setPivotInit( valsStr )
Sets the vals area for the pivot, and renders the Pivot again. To change multiple areas, use setOption API instead.
Parameter
nametyperequireddescription
valsStrStringYUse the comma as the field delimiter. The final shape depends on the field sequence.
Sample
pivotTable.setPivotInit( );
setPosition( left , top , mode )
Sets the position (left, top) of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
leftNumberYLeft position value or null
topNumberYTop position value or null
modeStringNPosition setting method. [default: absolute, delta]
absolute: The inputted value becomes the position. delta: The inputted value is added to the current position.
Sample
// (Example) Set the top position as 100px. componentId.setPosition(null, 100);
setReadOnly( readOnly )
Sets the readOnly proprety of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
readOnlyBooleanYSetting of the readOnly property. (“true”: Used. “false”: Not used.)
Sample
// Set the readOnly property as true. componentId.setReadOnly(true);
setSize( width , height )
Sets the size (width, height) of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
widthNumberYWidth of the component or null.
heightNumberYHeight of the component or null.
Sample
// (Example) Set the height of the component as 100px. componentId.setSize(null,100);
setStyle( propertyName , value )
Sets the CSS of the WebSquare component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
propertyNameStringYCSS property to set.
valueStringYValue to set as the specified CSS property
Sample
// (Example 1) Set the width as 200px. componentId.setStyle("width", "200px"); // (Example 2) Set the background as olive. componentId.setStyle("background-color","olive");
setUserData( key , value )
Sets random data in the WebSquare component. (Supported in all WebSquare components.)
Enter key values supported by the component. In case a key value not supported by the component is entered, corresponding logs will be displayed.
Parameter
nametyperequireddescription
keyStringYData key to set
valueStringYDefined data value
Sample
// Set 'data' key and 'WebSquare' value in the component. componentId.setUserData("data", "WebSquare"); // The key must be supported in the component. componentId.setUserData("title", "WebSquare"); // Following logs will be displayed. // !!!WARNING - [title] can't be defined as UserData.
setvals( valsStr )
Sets the vals area for the pivot, and renders the Pivot again. To change multiple areas, use setOption API instead.
Parameter
nametyperequireddescription
valsStrStringYUse the comma as the field delimiter. The final shape depends on the field sequence.
Sample
pivotTable.setvals( "field5, field5" ); // Locate field 5 and 6 in the vals area. pivotTable.setvals( "field6, field5" ); // Locate field 6 and 5 in the vals area. Different from the above example.
show( displayType )
Shows the WebSquare component on the page. (Supported in all WebSquare components.)
Sets the display property as specified and applies "visibility: show;" CSS.
Parameter
nametyperequireddescription
displayTypeStringNCSS display setting to apply.
block : Uses “display: block;”. (Default) inline : display: inline; none : display: none; "" : Restores to the previous display setting.
Sample
// (Example) display: block; componentId.show(); // (Example) Restore the previous display setting. componentId.show("");
toggleClass( className )
Adds or removes a CSS class to or from a WebSquare component. (Supported in all WebSquare components.)
Removes the class from the WebSquare component.
If the WebSquare component does not have the specified class, adds the class.
Only the classes added by addClass can be removed.
In order to remove classes directly defined as a property of the component, add the following in config.xml. // Add the following in config.xml. <style><removeDefaultClass value="true" /></style>
Parameter
nametyperequireddescription
classNameStringYClass to add or remove
Sample
// The class is directly defined in the inputBox component. <xf:input id="input1" style="position: relative;width: 144px;height: 21px;" class="tmpInputClass"></xf:input> // Add the following in config.xml. <style> <removeDefaultClass value="true" /> </style> // Remove tmpInputClass class. input1.toggleClass("tmpInputClass"); // Add the (previously removed) tmpInputClass. input1.toggleClass("tmpInputClass");
trigger( type , array )
Triggers a certain event in the component. (Supported in all WebSquare components.)
Parameter
nametyperequireddescription
typeStringYEvent to trigger
arrayArrayNArray of parameters to send to the event handler
Sample
// (Example 1) // Trigger the onclick event in input1 component. input1.trigger("onclick"); // (Example 2) // Trigger the onviewchange event in input1, and send (1, 2) parameter to the handler function. input1.trigger("onviewchange", [1,2]);
unbind( type , function )
Removes the event from the component. (Supported in all WebSquare component.)
Parameter
nametyperequireddescription
typeStringNEvent to remove. (If not specified, all events of the component will be removed.)
functionFunctionNHandler function of the event to remove. (If not specified, all handler functions of the event will be removed.)
Sample
// (Example 1) // Remove all events registered in the input1 component. input1.unbind(); // (Example 2) // Remove all handler functions for the onviewchange event of the input1 component. input1.unbind("onviewchange"); // (Example 3) // Remove func1 for the onviewchange event of the input1 component. input1.unbind("onviewchange", func1);
visible( flag )
[deprecated]
Use show/hide or setStyle instead.
The Engine sets the CSS visibility property.
Parameter
nametyperequireddescription
flagBooleanYCSS visibility setting
true : visibility: visible; false : visibility: hidden;