We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Pivot Table freezes when collapsing parent members

Hello, im having trouble with my pivot table.

Im using a function that sets dataSourceSettings.expandAll  to true. This works fine

The problem is, after all of my members are expanded, when I try closing one of them, the whole table freezes and shows a spinner which goes on until I reload the page, or use another function which sets  dataSourceSettings.expandAll  to false.

Is there a way I can optimize the table so this doesn't happen? keep in mind, the problem only arises after having expanded and then trying to collapse a member manually by clicking on the arrow to its left. If I collapse everything by setting  dataSourceSettings.expandAll  to false, the table works fine.

Heres the relevant code for my Table:

//Functions to expand and collapse, added in a separate button
menuItemClick(args: any) {
        if(args.value === i18n('cashFlowSmart.expand')) {
            this.drillMem = this.pivotObj.dataSourceSettings.drilledMembers;
            this.pivotObj.dataSourceSettings.drilledMembers = [];
            this.pivotObj.dataSourceSettings.expandAll = true;      
         }
         if(args.value === i18n('cashFlowSmart.collapse')) {  
            this.pivotObj.dataSourceSettings.drilledMembers = this.drillMem  
            this.pivotObj.dataSourceSettings.expandAll = false;        
         }
        this.isInitial = true;
        this.pivotObj.refresh();      
    }
<PivotViewComponent
                            id='PivotView'                          
                            dataSourceSettings={this.getDataSourceSettings()}
                            ref={(scope) => { this.pivotObj = scope; }}
                            width={'100%'}                                              
                            height={'1200'}                                                
                            gridSettings={this.gridSettings}      
                            allowConditionalFormatting={true}                  
                            showFieldList={true}  
                            showGroupingBar={false}  
                            showToolbar={true}
                            toolbar={this.toolbarOptions}
                            toolbarRender={this.beforeToolbarRender.bind(this)}
                            showTooltip = { true}
                            allowExcelExport={true}
                            allowPdfExport={true}                                          
                            drillThrough={this.drillThrough.bind(this)}  
                            enginePopulated={this.enginePopulated.bind(this)}                                            
                            load={this.load.bind(this)}
                            dataBound={this.dataBound.bind(this)}
                            allowDrillThrough={true}
                            drill={this.drill.bind(this)}                                      
                            enableVirtualization={true}
                            beforeExport={this.beforeExport.bind(this)}                        
                            >
                            <Inject services={[ConditionalFormatting, GroupingBar, Toolbar, PDFExport, ExcelExport, FieldList, DrillThrough, VirtualScroll ]} />
                        </PivotViewComponent>

 


1 Reply

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team April 4, 2023 02:28 PM UTC

Hi Hector,


We have checked the reported issue and we are unable to reproduce the reported issue at our end. However, we have prepared a sample with custom toolbar items using toolbar template option. Moreover the drill operations functions properly at our end. Please refer the below sample.


Sample:  https://stackblitz.com/edit/react-wesxqa-7rxmnx?file=index.js,index.html


Please see the below UG document to know more about the toolbar template.


Document: https://ej2.syncfusion.com/react/documentation/pivotview/tool-bar#toolbar-template


If the problem persists, please reproduce it in the provided sample and revert to us (or) send your sample that replicates the problem. This would allow us to investigate the reported problem at our end and provide a solution as soon as possible.


Regards,

Angelin Faith Sheeba.


Loader.
Up arrow icon