OnViewChange event or something similar

Hello

I have a pivot table / chart setup like this:

   <PivotViewDisplayOption Primary=Primary.Table View="View.Both"></PivotViewDisplayOption>


Is there any way to detect when the user changes from viewing a chart to viewing the table (i.e. an OnViewChange event).  I need to disable a button on my page if the user is looking at a table and enable when the user is looking at a chart.

Is this possible?

Thank you

2 Replies 1 reply marked as answer

SS Saranya Sivan Syncfusion Team March 15, 2021 05:44 PM UTC

Hi Richard, 
  
We have logged your requirement – “Event for display view switch in toolbar” as a feature task and it will be available in any one of our upcoming releases. 
  
You can track the same by using the following link:   
  
  
We appreciate your patience until then. 
  
Regards, 
Saranya Sivan. 



Marked as answer

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team July 4, 2022 10:16 AM UTC

Hi Richard,


We are glad to announce that our Essential Studio 2022 Volume 2 Main Release V20.2.36 is rolled out and the support to “Raise event while switching display view in toolbar option” has been included in this release. Please refer to the following sample.


Code snippet:

 

<SfPivotView>

     <PivotViewEvents TValue="PivotProductDetails" OnActionBegin="actionBegin" OnActionComplete="actionEnd" OnActionFailure="actionFailure"></PivotViewEvents>

</SfPivotView>

 

@Code{

//Triggers while an action begins

public void actionBegin(PivotActionBeginEventArgs args)

    {

        if(args.ActionName == "Table view" && args.ActionName == "Chart view")

        {

            args.Cancel=false;

            ActionBeginName = args.ActionName;

            Console.WriteLine(args.ActionName);

        }

    }

 

    //Triggers while action completed.

    public void actionEnd (PivotActionCompleteEventArgs args)

    {

        if( args.ActionName =="Table view shown" && args.ActionName == "Chart view shown")

        {

            ActionCompleteName=args.ActionName;

            Console.WriteLine(args.ActionName);

        }

       

 

    }

 

    //Triggers while action failed to achieve desired result.

    public void actionFailure(PivotActionFailureEventArgs args)

    {

        Console.WriteLine(args.ErrorInfo);

        Console.WriteLine(args.ActionName);

    }

}


Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/PivotTable-781691219


Release Notes: https://blazor.syncfusion.com/documentation/release-notes/20.2.36?type=all#pivot-table


We thank you for your support and appreciate your patience in waiting for this release. Please contact us if you require any further assistance.


Regards,

Angelin Faith Sheeba.


Loader.
Up arrow icon