Properties |
||||||||
source | Object | null | ||||||
Gets or sets pivot source adapter used to supply data to the pivot grid. Code example:
var column1Values = [ 'a', 'b', 'c', 'd' ]; var column2Values = [ 'e', 'f', 'g', 'h' ]; var column3Values = [ 'i', 'j', 'k', 'l' ]; var column4Values = [ '2.25', '1.5', '3.0', '3.3', '4.5' ]; var myData = []; for (var i = 0; i < 500; i++) { var row = {}; row.column1 = column1Values[Math.floor(Math.random() * column1Values.length)]; row.column2 = column2Values[Math.floor(Math.random() * column2Values.length)]; row.column3 = column3Values[Math.floor(Math.random() * column3Values.length)]; row.column4 = parseFloat(column4Values[Math.floor(Math.random() * column4Values.length)]); myData.push(row); } var source = { localdata: myData, datatype: 'array', datafields: [ { name: 'column1', type: 'string' }, { name: 'column2', type: 'string' }, { name: 'column3', type: 'string' }, { name: 'column4', type: 'number' } ] }; var dataAdapter = new $.jqx.dataAdapter(source); dataAdapter.dataBind(); // create a pivotDataSource from the dataAdapter var pivotDataSource = new $.jqx.pivot( dataAdapter, { pivotValuesOnRows: false, rows: [{ dataField: 'column1' }, { dataField: 'column2'}], columns: [{ dataField: 'column3'}], values: [ { dataField: 'column4', text: 'Sum of column4', 'function': 'sum'}, { dataField: 'column4', text: 'Count of column4', 'function': 'count'} ] }); // create a pivot grid $('#divPivotGrid').jqxPivotGrid({ source: pivotDataSource }); |
||||||||
localization | Object | null | ||||||
Gets or sets the localization object used to localize the text elements of the pivot grid. Code example:
var customLocalizationObj = { sortascendingstring: 'Sortiere aufsteigend', sortdescendingstring: 'Sortiere absteigend', sortremovestring: 'Entferne Sortierung' }; $('#myPivotGrid').jqxPivotGrid({localization: customLocalizationObj}); |
||||||||
scrollBarsEnabled | Boolean | true | ||||||
Gets or sets whether the scrollbars of the pivot grid are enabled or disabled. Code example:
$('#myPivotGrid').jqxPivotGrid({scrollBarsEnabled: false}); |
||||||||
selectionEnabled | Boolean | true | ||||||
Gets or sets whether selection in the pivot grid is enabled or disabled. Code example:
$('#myPivotGrid').jqxPivotGrid({multipleSelectionEnabled: false}); |
||||||||
multipleSelectionEnabled | Boolean | true | ||||||
Gets or sets whether the multiple selection in the pivot grid is enabled or disabled. Code example:
$('#myPivotGrid').jqxPivotGrid({multipleSelectionEnabled: false}); |
||||||||
treeStyleRows | Boolean | true | ||||||
Gets or sets the rows of the pivot grid are displayed as a tree structure or using classic OLAP style. Code example:
$('#myPivotGrid').jqxPivotGrid({treeStyleRows: false}); |
||||||||
autoResize | Boolean | false | ||||||
Gets or sets if the size of pivot grid adjusts automatically to display the entire content. Code example:
$('#myPivotGrid').jqxPivotGrid({treeStyleRows: true}); |
||||||||
itemsRenderer | function | |||||||
Custom rendering function used to render the pivot rows and columns. The function should return a string which is valid HTML. Code example:
$('#myPivotGrid').jqxPivotGrid( { source: pivotDataSource, itemsRenderer: function (pivotItem) { var backgroundColor = pivotItem.isColumn ? 'rgba(187, 232, 227, 255)' : 'rgba(203, 254, 187, 255)'; return "<div style='background: " + backgroundColor + "; width: calc(100% - 8px); height: calc(100% - 8px); padding: 4px;'>" + pivotItem.text + "</div>"; }, cellsRenderer: function (pivotCell) { var backgroundColor = 'rgba(253, 254, 207, 255)'; var cellText = pivotCell.value == 0 ? '' : pivotCell.formattedValue; return "<div style='background: " + backgroundColor + "; width: calc(100%-8px); height: 100%; padding: 4px; margin: 0px;'>" + cellText + "</div>"; } }); |
||||||||
cellsRenderer | function | |||||||
Custom rendering function used to render the pivot cells. The function should return a string which is valid HTML. Code example:
$('#myPivotGrid').jqxPivotGrid( { source: pivotDataSource, itemsRenderer: function (pivotItem) { var backgroundColor = pivotItem.isColumn ? 'rgba(187, 232, 227, 255)' : 'rgba(203, 254, 187, 255)'; return "<div style='background: " + backgroundColor + "; width: calc(100% - 8px); height: calc(100% - 8px); padding: 4px;'>" + pivotItem.text + "</div>"; }, cellsRenderer: function (pivotCell) { var backgroundColor = 'rgba(253, 254, 207, 255)'; var cellText = pivotCell.value == 0 ? '' : pivotCell.formattedValue; return "<div style='background: " + backgroundColor + "; width: calc(100%-8px); height: 100%; padding: 4px; margin: 0px;'>" + cellText + "</div>"; } }); |
||||||||
Events |
||||||||
pivotitemexpanding | Event | |||||||
This event is triggered when a pivot item is expanding. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotitemexpanding event:
$('#myPivotGrid').on('pivotitemexpanding', function (event) { alert('Pivot item expanding: ' + event.args.pivotItem.text); }); |
||||||||
pivotitemexpanded | Event | |||||||
This event is triggered after a pivot item is expanded. Code example:Handling the pivotitemexpanded event:
$('#myPivotGrid').on('pivotitemexpanded', function (event) { alert('Pivot item expanded: ' + event.args.pivotItem.text); }); |
||||||||
pivotitemcollapsing | Event | |||||||
This event is triggered when a pivot item is collapsing. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotitemcollapsing event:
$('#myPivotGrid').on('pivotitemcollapsing', function (event) { alert('Pivot item collapsing: ' + event.args.pivotItem.text); }); |
||||||||
pivotitemcollapsed | Event | |||||||
This event is triggered after a pivot item is collapsed. Code example:Handling the pivotitemcollapsed event:
$('#myPivotGrid').on('pivotitemcollapsed', function (event) { alert('Pivot item collapsed: ' + event.args.pivotItem.text); }); |
||||||||
sortchanging | Event | |||||||
This event is triggered the sorting is about to change. You may use the event's cancel flag to stop further processing. Code example:Handling the sortchanging event:
$('#myPivotGrid').on('sortchanging', function (event) { alert('Sort changing triggered. Pivot item: ' + event.args.pivotItem.text + ' , Sort order:' + event.args.sortOrder ); }); |
||||||||
sortchanged | Event | |||||||
This event is triggered after the sorting order has changed. Code example:Handling the sortchanged event:
$('#myPivotGrid').on('sortchanged', function (event) { alert('Sort changed. Pivot item: ' + event.args.pivotItem.text + ' , Sort order:' + event.args.sortOrder ); }); |
||||||||
sortremoving | Event | |||||||
This event is triggered the sorting is about to be removed. You may use the event's cancel flag to stop further processing. Code example:Handling the sortremoving event:
$('#myPivotGrid').on('sortremoving', function (event) { alert('Sort removing triggered. Pivot item: ' + event.args.pivotItem.text + ' , Sort order:' + event.args.sortOrder ); }); |
||||||||
sortremoved | Event | |||||||
This event is triggered after the sorting has been sortremoved. Code example:Handling the sortremoved event:
$('#myPivotGrid').on('sortremoved', function (event) { alert('Sort removed. Pivot item: ' + event.args.pivotItem.text + ' , Sort order:' + event.args.sortOrder ); }); |
||||||||
pivotitemselectionchanged | Event | |||||||
This event is triggered after the selection of a pivot item has changed. Code example:Handling the pivotitemselectionchanged event:
$('#myPivotGrid').on('pivotitemselectionchanged', function (event) { alert('Pivot item: ' + event.args.pivotItem.text + ' , selected:' + event.args.selected ); }); |
||||||||
pivotcellmousedown | Event | |||||||
This event is triggered on mousedown over a pivot grid cell. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotcellmousedown event:
$('#myPivotGrid').on('pivotcellmousedown', function (event) { alert('cell mousedown, row: ' + event.args.pivotRow.text + ' , column:' + event.args.pivotColumn.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
pivotcellmouseup | Event | |||||||
This event is triggered on mouseup over a pivot grid cell. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotcellmouseup event:
$('#myPivotGrid').on('pivotcellmouseup', function (event) { alert('cell mouseup, row: ' + event.args.pivotRow.text + ' , column:' + event.args.pivotColumn.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
pivotcellclick | Event | |||||||
This event is triggered on click over a pivot grid cell. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotcellclick event:
$('#myPivotGrid').on('pivotcellclick', function (event) { alert('cell click, row: ' + event.args.pivotRow.text + ' , column:' + event.args.pivotColumn.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
pivotcelldblclick | Event | |||||||
This event is triggered on double click over a pivot grid cell. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotcelldblclick event:
$('#myPivotGrid').on('pivotcelldblclick', function (event) { alert('cell double click, row: ' + event.args.pivotRow.text + ' , column:' + event.args.pivotColumn.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
pivotitemmousedown | Event | |||||||
This event is triggered on mousedown over a pivot grid item. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotitemmousedown event:
$('#myPivotGrid').on('pivotitemmousedown', function (event) { alert('Pivot item mousedown: ' + event.args.pivotItem.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
pivotitemmouseup | Event | |||||||
This event is triggered on mouseup over a pivot grid item. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotitemmouseup event:
$('#myPivotGrid').on('pivotitemmouseup', function (event) { alert('Pivot item mouseup: ' + event.args.pivotItem.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
pivotitemclick | Event | |||||||
This event is triggered on click over a pivot grid item. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotitemclick event:
$('#myPivotGrid').on('pivotitemclick', function (event) { alert('Pivot item click: ' + event.args.pivotItem.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
pivotitemdblclick | Event | |||||||
This event is triggered on double click over a pivot grid item. You may use the event's cancel flag to stop further processing. Code example:Handling the pivotitemdblclick event:
$('#myPivotGrid').on('pivotitemdblclick', function (event) { alert('Pivot item double click: ' + event.args.pivotItem.text + ' , mouse button:' + event.args.mousebutton ); }); |
||||||||
Methods |
||||||||
getInstance | Method | |||||||
Returns the instance of the pivot grid component
Return Value Object Code example:
var myPivotGridInstance = $('#myPivotGrid').jqxPivotGrid('getInstance'); |
||||||||
refresh | Method | |||||||
Refreshes the content of the pivot grid component
Return Value None Code example:
$('#myPivotGrid').jqxPivotGrid('refresh'); |
||||||||
destroy | Method | |||||||
Destroys the pivot grid component instance
Return Value None Code example:
$('#myPivotGrid').jqxPivotGrid('destroy'); |
||||||||
getPivotRows | Method | |||||||
Return the pivot rows of the pivot grid
Return Value Object Code example:
var myPivotGridRows = $('#myPivotGrid').jqxPivotGrid('getPivotRows'); alert('The pivot grid has ' + myPivotGridRows.items.length + ' rows.'); |
||||||||
getPivotColumns | Method | |||||||
Return the pivot columns of the pivot grid
Return Value Object Code example:
var myPivotGridColumns = $('#myPivotGrid').jqxPivotGrid('getPivotColumns'); alert('The pivot grid has ' + myPivotGridColumns.items.length + ' columns.'); |
||||||||
getPivotCells | Method | |||||||
Return the pivot cells of the pivot grid
Return Value Object Code example:
var myPivotGridCells = $('#myPivotGrid').jqxPivotGrid('getPivotCells'); |
Properties |
||||||||
type | undefined | pivotGrid | ||||||
Gets or sets the type of the pivot designer - pivotGrid or pivotChart. |
||||||||
target | Object | |||||||
Gets or sets the instance of the widget component controlled by the pivot designer component. |
||||||||
Events |
||||||||
Methods |
||||||||
refresh | Method | |||||||
Return Value None |
||||||||
destroy | Method | |||||||
Return Value None |
Properties |
||
pivotRow | Object | |
The row of the pivot cell. |
||
pivotColumn | Object | |
The column of the pivot cell. |
Properties |
||
prefix | String | |
Optional text that appears at the start of the formatted string |
||
sufix | String | |
Optional text that appears at the end of the formatted string |
||
decimalSeparator | String | . |
Separator for the decimal point in the cell's value |
||
thousandsSeparator | String | , |
Separator for the thousands in the cell's value |
||
decimalPlaces | Number | 2 |
Number of decimal places for the cell's value |
||
negativeWithBrackets | Boolean | false |
Determines if negative numbers will be displayed in brackets or with a negative sign. |
Properties |
|||||||||||||||||
Methods |
|||||||||||||||||
hitTest | Method | ||||||||||||||||
Returns the pivot cell at the corresponding position if exists
Return Value Object |
|||||||||||||||||
clear | Method | ||||||||||||||||
Clears all pivot cells
Return Value None |
|||||||||||||||||
setCellValue | Method | ||||||||||||||||
Sets the value of a pivot cell
Return Value None |
|||||||||||||||||
getCellValue | Method | ||||||||||||||||
Gets the value of a pivot cell
Return Value Object |
|||||||||||||||||
drillThroughCell | Method | ||||||||||||||||
Drills through a pivot cells and returns the respective source data records
Return Value Array |
|||||||||||||||||
selectCell | Method | ||||||||||||||||
Selects a pivot cell
Return Value None |
|||||||||||||||||
unselectCell | Method | ||||||||||||||||
Unselects a pivot cell
Return Value None |
|||||||||||||||||
clearSelection | Method | ||||||||||||||||
Clears the selection of all selected pivot cells
Return Value None |
|||||||||||||||||
isCellSelected | Method | ||||||||||||||||
Checks if a pivot cell is selected
Return Value Boolean |
|||||||||||||||||
getSelectedCellsCount | Method | ||||||||||||||||
Returns the number of selected cells
Return Value Number |
|||||||||||||||||
getSelectedCells | Method | ||||||||||||||||
Returns an array of all selected cells
Return Value Array |
|||||||||||||||||
getNextCell | Method | ||||||||||||||||
Returns the cell left, right, above or below a specific pivot cell
Return Value Object |
Properties |
||||||||||||||
resizable | Boolean | true | ||||||||||||
Gets or sets if the collection of pivot items is resizable. |
||||||||||||||
sortable | Boolean | true | ||||||||||||
Gets or sets if the collection of pivot items is sortable. |
||||||||||||||
showExpandCollapseButtons | Boolean | true | ||||||||||||
Gets or sets if expand/collapse buttons are visible. |
||||||||||||||
parentPivotGrid | Object | null | ||||||||||||
Returns a reference to the parent pivot grid instance. |
||||||||||||||
items | Array | [] | ||||||||||||
Returns an array of all child pivot items. |
||||||||||||||
valueItems | Array | [] | ||||||||||||
Returns an array of all child pivot value items. |
||||||||||||||
isHidden | Boolean | false | ||||||||||||
Returns true if the pivot items collection is hidden. |
||||||||||||||
Methods |
||||||||||||||
show | Method | |||||||||||||
Makes the pivot items collection visible
Return Value None |
||||||||||||||
hide | Method | |||||||||||||
Hides the pivot items collection
Return Value None |
||||||||||||||
refresh | Method | |||||||||||||
Refreshes the content of the pivot items collection
Return Value None |
||||||||||||||
getHierarchyDepth | Method | |||||||||||||
Returns the depth of the collection
Return Value Number |
||||||||||||||
autoResize | Method | |||||||||||||
Auto resizes the pivot items collection
Return Value None |
||||||||||||||
getSortItem | Method | |||||||||||||
Returns the sort item of the collection
Return Value Object |
||||||||||||||
getSortOrder | Method | |||||||||||||
Returns the sort order of the collection
Return Value Object |
||||||||||||||
sortBy | Method | |||||||||||||
Sorts the items collection
Return Value None |
||||||||||||||
removeSort | Method | |||||||||||||
Removes the sort order of the collection
Return Value None |
||||||||||||||
selectItem | Method | |||||||||||||
Selects a pivot item
Return Value None |
||||||||||||||
unselectItem | Method | |||||||||||||
Clears the selection of a pivot item
Return Value None |
||||||||||||||
clearSelection | Method | |||||||||||||
Clears the selection of all items in the collection
Return Value None |
||||||||||||||
getSelectedItems | Method | |||||||||||||
Returns all selected items in an array
Return Value Array |
Properties |
||
dataField | String | |
The dataField in the data source used for this pivot field. |
||
text | String | |
The text which will appear in the pivot designer when using this field. |
||
align | String | |
Text alignment when the value of this field is displayed on the pivot rows or pivot columns. |
||
className | String | |
Name of style to use when displaying this field on the pivot rows or columns. |
||
classNameSelected | String | |
Name of style to use when displaying this field on the pivot rows or columns and column or row is selected. |
Properties |
||
dataField | String | |
The dataField in the data source used for this pivot filter field. |
||
text | String | |
The text which will appear in the pivot designer when using this field. |
||
filterFunction | function | |
Implementation of the filtering function used to skip/filter records from the data source. The function should return true if the record should be filtered, otherwise false. |
Properties |
|||||||||||
isExpanded | Boolean | false | |||||||||
Returns true if the pivot item is expanded. |
|||||||||||
isHidden | Boolean | false | |||||||||
Returns true if the pivot item is hidden. |
|||||||||||
isSelected | Boolean | false | |||||||||
Returns true if the pivot item is hidden. |
|||||||||||
parentItem | Object | null | |||||||||
Returns a reference to the parent item. |
|||||||||||
hierarchy | Object | null | |||||||||
Returns a reference to the parent rows or columns hierarchy. |
|||||||||||
parentPivotGrid | Object | null | |||||||||
Returns a reference to the parent pivot grid instance. |
|||||||||||
items | Array | [] | |||||||||
Returns an array of all child pivot items. |
|||||||||||
valueItems | Array | [] | |||||||||
Returns an array of all child pivot value items. |
|||||||||||
Methods |
|||||||||||
getWidth | Method | ||||||||||
Gets the width of the pivot item
Return Value Number |
|||||||||||
getDisplayWidth | Method | ||||||||||
Gets the displayed width of the pivot item
Return Value Number |
|||||||||||
autoResize | Method | ||||||||||
Auto resizes the pivot item
Return Value None |
|||||||||||
getHeight | Method | ||||||||||
Gets the height of the pivot item
Return Value Number |
|||||||||||
getDisplayHeight | Method | ||||||||||
Gets the displayed height of the pivot item
Return Value Number |
|||||||||||
setHeight | Method | ||||||||||
Sets the height of the pivot item
Return Value None |
|||||||||||
expand | Method | ||||||||||
Expands the pivot item so all sub-items will be visible
Return Value None |
|||||||||||
collapse | Method | ||||||||||
Collapses the pivot item so all sub-items will be invisible
Return Value None |
Properties |
||||||||||||||
resizable | Boolean | true | ||||||||||||
Gets or sets if the collection of pivot items is resizable. |
||||||||||||||
sortable | Boolean | true | ||||||||||||
Gets or sets if the collection of pivot items is sortable. |
||||||||||||||
showExpandCollapseButtons | Boolean | true | ||||||||||||
Gets or sets if expand/collapse buttons are visible. |
||||||||||||||
parentPivotGrid | Object | null | ||||||||||||
Returns a reference to the parent pivot grid instance. |
||||||||||||||
items | Array | [] | ||||||||||||
Returns an array of all child pivot items. |
||||||||||||||
valueItems | Array | [] | ||||||||||||
Returns an array of all child pivot value items. |
||||||||||||||
isHidden | Boolean | false | ||||||||||||
Returns true if the pivot items collection is hidden. |
||||||||||||||
Methods |
||||||||||||||
show | Method | |||||||||||||
Makes the pivot items collection visible
Return Value None |
||||||||||||||
hide | Method | |||||||||||||
Hides the pivot items collection
Return Value None |
||||||||||||||
refresh | Method | |||||||||||||
Refreshes the content of the pivot items collection
Return Value None |
||||||||||||||
getHierarchyDepth | Method | |||||||||||||
Returns the depth of the collection
Return Value None |
||||||||||||||
autoResize | Method | |||||||||||||
Auto resizes the pivot items collection
Return Value None |
||||||||||||||
getSortItem | Method | |||||||||||||
Returns the sort item of the collection
Return Value Object |
||||||||||||||
getSortOrder | Method | |||||||||||||
Returns the sort order of the collection
Return Value Object |
||||||||||||||
sortBy | Method | |||||||||||||
Sorts the items collection
Return Value None |
||||||||||||||
removeSort | Method | |||||||||||||
Removes the sort order of the collection
Return Value None |
||||||||||||||
selectItem | Method | |||||||||||||
Selects a pivot item
Return Value None |
||||||||||||||
unselectItem | Method | |||||||||||||
Clears the selection of a pivot item
Return Value None |
||||||||||||||
clearSelection | Method | |||||||||||||
Clears the selection of all items in the collection
Return Value None |
||||||||||||||
getSelectedItems | Method | |||||||||||||
Returns all selected items in an array
Return Value Array |
Properties |
||
pivotValuesOnRows | Boolean | false |
Determines whether the pivot values will be displayed on rows or columns. |
||
rows | Boolean | [] |
A list of data fields which will be used to build the pivot rows. |
||
columns | Boolean | [] |
A list of data fields which will be used to build the pivot columns. |
||
values | Boolean | [] |
A list of data fields which will be used to build the pivot values. |
||
filters | Boolean | [] |
A list of filters to apply on the source records while building the pivot table. |
Properties |
||
dataField | String | |
The dataField in the data source used for this pivot field. |
||
function | String|function | |
The data aggregation function to use when calculating the cells values. You can either use the name of one of the built in functions like 'sum', 'count', 'min', 'max', 'product', 'average' or provide the implementation of your own function. |
||
text | String | |
The text which will appear in the pivot designer when using this field. |
||
align | String | |
Text alignment when the value of this field is displayed on the pivot rows or pivot columns. |
||
className | String | |
Name of style to use when displaying this field on the pivot rows or columns. |
||
classNameSelected | String | |
Name of style to use when displaying this field on the pivot rows or columns and column or row is selected. |
||
cellsClassName | String | |
Name of style to use when displaying the cells of this pivot value field. |
||
cellsClassNameSelected | String | |
Name of style to use when displaying this cells this pivot value field when the cells are selected. |
||
formatSettings | Object | {} |
|
Properties |
||
x | Number | |
X coordinate |
||
y | Number | |
Y coordinate |