question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to reset State in dx-pivot-grid?

See original GitHub issue

I am using [stateStoring] like this-

<button (click)="Reset()">Reset State</button>

    <dx-pivot-grid style="width:600px;display:block" [(dataSource)]="pivotSource" [allowSorting]="true"
        [allowSortingBySummary]="true" [allowFiltering]="true" [allowExpandAll]="true"  [showBorders]="true"

        [fieldChooser]="{enabled: true}"
        [fieldPanel]="{visible: true}"
        [stateStoring]="{
            enabled: true,
            type: localStorage,
            storageKey: dx-widget-gallery-pivotgrid-storing
        }"
        >
    </dx-pivot-grid>

I want to know how to reset state on click on reset button in above snippet?

Also, Is there a way to store state other than localStorage type?

My Environment is- Angular2 version RC5 devextreme-angular2 version: 16.1.5

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
dxvladislavvolkovcommented, Sep 28, 2016

Hello! You can read more about types of the storage here

Try to use the following code to reset the state:

import {Component, ViewChild} from '@angular/core';
import {DxPivotGrid} from 'devextreme-angular2'
...
export class App {
....
    @ViewChild(DxPivotGrid) pivotGrid: DxPivotGrid
    Reset() {
        this.pivotGrid.instance.getDataSource().state({});
    }
}
0reactions
sanket360commented, Oct 9, 2016

Thanks @dxvladislavvolkov 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

State Persistence - Angular Pivot Grid - DevExtreme
With localStorage, the state persists across browser sessions; with sessionStorage, it is reset after the current session. This demo uses localStorage.
Read more >
Reset PivotGrid Expand State - Kendo UI for jQuery
The following example demonstrates how to reset the expand/collapse state and fetch the data again in a Kendo UI PivotGrid widget.
Read more >
pivot table - DevExtreme Complete - ComponentSource
dxPivotGrid - State persistence does not have effect when a ... DevExtreme Pivot Grid PivotGrid- A scroll position is reset when an item...
Read more >
Remove row in dx-pivot-grid - angular - Stack Overflow
I find out a workaround, it is not completely in manner of typescript and angular, because it avoids type checking, I add //@ts-ignore...
Read more >
DevExpress WPF Pivot Grid: Getting Started - YouTube
Using DevExpress MVVM Magic with WPF · DevExpress WPF Tutorials · Kwiyitaho ||Self care. Final Part 2. · Revisiting App State : Carl...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found