React PivotGrid Methods
beginUpdate()
Prevents the widget from refreshing until the endUpdate() method is called.
The beginUpdate() and endUpdate() methods prevent the widget from excessive updates when you are changing multiple widget settings at once. After the beginUpdate() method is called, the widget does not update its UI until the endUpdate() method is called.
See Also
- Call Methods: jQuery | Angular | AngularJS | Knockout | ASP.NET MVC
bindChart(chart, integrationOptions)
Binds a Chart to the PivotGrid.
The Chart to be bound to the PivotGrid.
Accepts the Chart's instance, jQuery element or container selector.
Name | Type | Description |
---|---|---|
inverted |
Default Value: false. |
|
dataFieldsDisplayMode |
Default Value: "splitAxes".
Applies only if the PivotGrid contains several data fields. |
|
putDataFieldsInto |
Default Value: "series".
|
|
alternateDataFields |
Default Value: true. |
|
processCell |
Allows you to process cell data before the Chart visualizes it. |
|
customizeChart |
Allows you to customize the Chart's appearance. |
|
customizeSeries |
Allows you to customize the series. |
Main article: Integration with Chart
See Also
- Call Methods: jQuery | Angular | AngularJS | Knockout | ASP.NET MVC
defaultOptions(rule)
defaultOptions is a static method that the widget class supports. The following code demonstrates how to specify default options for all instances of the PivotGrid widget in an application executed on the desktop.
jQuery
DevExpress.ui.dxPivotGrid.defaultOptions({ device: { deviceType: "desktop" }, options: { // Here go the PivotGrid options } });
Angular
import PivotGrid from 'devextreme/ui/pivot_grid'; // ... export class AppComponent { constructor () { PivotGrid.defaultOptions({ device: { deviceType: "desktop" }, options: { // Here go the PivotGrid options } }); } }
dispose()
The following code disposes of an PivotGrid instance that corresponds to the element ID (or reference variable in Angular) and removes the element from the DOM:
jQuery
$("#myPivotGrid").dxPivotGrid("dispose"); $("#myPivotGrid").remove();
Angular
<dx-pivot-grid #pivotGridVar id="myPivotGrid"></dx-pivot-grid>
import { ..., ViewChild } from "@angular/core"; import { DxPivotGridComponent } from "devextreme-angular"; // ... export class AppComponent { @ViewChild("pivotGridVar") pivotGrid: DxPivotGridComponent; removePivotGrid (e) { this.pivotGrid.instance.dispose(); document.getElementById("myPivotGrid").remove(); } }
endUpdate()
Refreshes the widget after a call of the beginUpdate() method.
Main article: beginUpdate()
See Also
- Call Methods: jQuery | Angular | AngularJS | Knockout | ASP.NET MVC
getDataSource()
The PivotGridDataSource instance.
This method is commonly used to link the pivot grid with the PivotGridFieldChooser widget.
See Also
- Call Methods: jQuery | Angular | AngularJS | Knockout | ASP.NET MVC
getFieldChooserPopup()
Use this method to show and hide the field chooser window programmatically. The code below demonstrates how you can display the field chooser from code.
pivotGrid.getFieldChooserPopup().show();
See Also
- Call Methods: jQuery | Angular | AngularJS | Knockout | ASP.NET MVC
getInstance(element)
getInstance is a static method that the widget class supports. The following code demonstrates how to get the PivotGrid instance found in an element with the myPivotGrid
ID:
// Modular approach import PivotGrid from 'devextreme/ui/pivot_grid'; ... let element = document.getElementById("myPivotGrid"); let instance = PivotGrid.getInstance(element) as PivotGrid; // Non-modular approach let element = document.getElementById("myPivotGrid"); let instance = DevExpress.ui.dxPivotGrid.getInstance(element);
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.