Enable/disable aggregates toolbar

Hi, it seems there are no similar questions about this.

I would like to enable/disable the aggregates toolbar on user's demand. I have implemented it such way inside the GridComponent:

{(state.aggregate &&
<AggregatesDirective>
<AggregateDirective>
<AggregateColumnsDirective>
<AggregateColumnDirective ... />
</AggregateColumnsDirective>
</AggregateDirective>
</AggregatesDirective>
})}

The state.aggregate is a boolean variable stored in the state, enabled/disabled on user's demand outside the GridComponent.

It doesn't seem to be working. The aggregates won't disappear when state.aggregate is set to false.

How can I make it disappear?


Best regards


1 Reply

VS Vignesh Sivagnanam Syncfusion Team June 29, 2021 01:45 PM UTC

Hi Antonio 
  
Greetings from Syncfusion support 
  
Based on your query you want to display the aggregate rows based on condition. We have prepared a sample and, in this sample, we display the aggregate rows based on the condition and toggle the display using the external button. You can use the below code example to achieve your requirement, 
  
Please refer the below code example for your reference, 
  
  
Regards 
Vignesh Sivagnanam 


Loader.
Up arrow icon