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

Is it possible to show only the member filter popup?

In code or by adding the field list popup button to the toolbar its possible to present the pivot table field list popup.  However this popup includes fields for all dimensions in the pivot table.

Is it possible to cause just the member select list for a single dimension to be shown?  This is the popup shown when the filter icon of a dimension button is clicked?  The code which presents this popup is in the event-base module.

If so, how can this popup be instantiated and shown?

There are two uses cases.  One is to have several dimensions on the pivot table but only allow the user to change the member selection of one dimension.  

Another use case is where, again, there are several dimensions used and the member selections only one is permitted but the pivot table is not shown because only the data is needed which will be processed by other code.

In the first use case its possible a button, if a button can be used, could be attached to the pivot table in some way (the toolbar for example).  In the second case the button will need to be free-standing.

Thanks



9 Replies 1 reply marked as answer

AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 12, 2022 02:34 PM UTC

Hi Bill Sedon,


Please find the response below:


Query

Comments

If so, how can this popup be instantiated and shown?

There are two uses cases.  One is to have several dimensions on the pivot table but only allow the user to change the member selection of one dimension.  

To use the filter dialog for a specific dimension, use the showFilterIcon property on the rows, columns, and filters options in the bound report to hide the filter icon for fields other than this field. To disable the filter icon for fields (i.e., dimensions) that are not bound in the report, use the fieldMapping option's showFilterIcon property. Please see the code example below.

 

Code example:

dataSourceSettings: {

    rows: [

      {

        name: '[Customer].[Customer Geography]',

        caption: 'Customer Geography',

        showFilterIcon: false,

      },

    ],

    columns: [

      {

        name: '[Product].[Product Categories]',

        caption: 'Product Categories',

        showFilterIcon: false,

      },

  ],

: [

      { name: '[Customer].[Country]'showFilterIcon: false },

      { name: '[Customer].[City]'showFilterIcon: false },

    ],

  },

 

Output screenshot:

Another use case is where, again, there are several dimensions used and the member selections only one is permitted but the pivot table is not shown because only the data is needed which will be processed by other code.

You can slice the data using filter and filterSettings, which will be considered during aggregation but will not be displayed in the pivot table. Please refer the below code example.

 

Code example:

dataSourceSettings: {

    filters: [{ name: '[Date].[Fiscal]'caption: 'Date Fiscal' }],

    filterSettings: [

      {

        name: '[Date].[Fiscal]',

        items: [

          '[Date].[Fiscal].[Fiscal Quarter].&[2002]&[4]',

          '[Date].[Fiscal].[Fiscal Year].&[2005]',

        ],

        levelCount: 3,

      },

    ],

  },

 


Please let us know if you have any concerns.


Regards,

Angelin Faith Sheeba.



BS Bill Seddon December 12, 2022 02:39 PM UTC

Sorry, your reply does not answer the question.  Your answer only describes how to add to make the filter icon appear on a dimension button.  This is very well documented and there are examples available on the Syncfusion site.

As stated in the question, I want to be able to display the popup from a button on the *toolbar* and also be able to display the popup using an *external* button.

Thanks.



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 13, 2022 01:49 PM UTC

Hi Bill,


We've prepared a sample that uses an external button and a custom button option in the toolbar UI to display the member filter pop-up for the “country” field. Please refer the below code example. 


Code Example:

//For external filter button.

document.getElementById('btn').onclick = function () {

  // Get the external filter button element here.

  var mouseEventArgs = {

    target: document.getElementById('btn'),

  };

  pivotGridObj.pivotButtonModule.updateFiltering(mouseEventArgs);

};

 

//For toolbar filter button

toolbarRender: function (args) {

    // Create a custom toolbar items here

    args.customToolbar.splice(100, {

      text: 'Country filter',

      tooltipText: 'Country filter',

      click: this.toolbarClicked.bind(this),

    });

  },

  toolbarClicked: function (args) {

    // Get the toolbar filter button element here.

    let mouseEventArgs = {

      target: document.getElementsByClassName('e-tbar-btn')[6],

    };

    pivotGridObj.pivotButtonModule.updateFiltering(mouseEventArgs);

  },

  dataBound: function (args) {

    // Need to set the id for the parent element of toolbar filter button

    let filter = document.querySelectorAll('.e-toolbar-item')[10];

    if (filter) {

      filter.setAttribute('id''Country');

    }

  },


Sample:  https://stackblitz.com/edit/x9dd5j-6tse2h?file=index.js,index.html


Output screenshot:


Please let us know if you have any concerns. 


Regards, 

Angelin Faith Sheeba



Marked as answer

BS Bill Seddon December 13, 2022 03:35 PM UTC

Thank you very much.  This is fantastic.



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team December 14, 2022 06:07 AM UTC


Thanks for the update. Please contact us if you have any other queries. We are always happy to assist you.



BS Bill Seddon January 9, 2023 06:34 PM UTC

The answer you provided is great.  Now it will be great to know if it is possible to present the dimensions selector independently.  The dimensions selector is part of the field list dialog but is it possible to present a window for selecting one or more dimensions outside the field list?



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team January 10, 2023 12:22 PM UTC

Hi Bill,


Please use the code example below to get the fieldlist information in which you can get the OLAP cube's measures and dimensions details and customize based on your needs.


Code example:

enginePopulated: function (args) {

    console.log(pivotObj.olapEngineModule.fieldList);

  }


However, we have prepared a sample to add a dimension in rows using button click. Please refer the below sample.


Sample: https://stackblitz.com/edit/nsgo8m-t44tw5?file=index.html,index.js


Regards,

Angelin Faith Sheeba




BS Bill Seddon January 10, 2023 12:35 PM UTC

Thank you.



AP AngelinFaithSheeba PaulvannanRajadurai Syncfusion Team January 11, 2023 08:44 AM UTC

Thanks for the update. Please contact us if you have any other queries. We are always happy to assist you.


Loader.
Up arrow icon