Menu
Download Free Trial
Table of contents

getFilterProperties

getFilterProperties(hierarchyName:String):Object

[starting from version: 1.6]

Returns the filter properties set for the specified hierarchy. If data load is in progress or filter is not applied an empty Object will be returned.

Parameters

  • hierarchyName – the name of the hierarchy.

Returns

Object that describes the filter set for the hierarchy. The object always has type and members properties. It may have quantity and measure properties if filter on values is defined. It has all four properties if both filters, on hierarchy’s members and on values, are defined:

  • type – Represents the filter type applied to the hierarchy. It can be:
    • 'none' – filter is not applied to the hierarchy,
    • 'members' – the filter on hierarchy’s members is applied,
    • 'top' – the filter Top X is applied on values,
    • 'bottom' – the filter Bottom X is applied on values.
  • members – Array of objects represents the filter on hierarchy’s members. Each object in array contains the following parameters: caption, uniqueName, and hierarchyName.
  • quantity – Represents the filter on values. Number of elements to choose for the Top X filter if type is 'top' or for the Bottom X filter if type is 'bottom'.
  • measure – Represents the filter on values. The name of the measure on which Top X or Bottom X filter will be applied.

Example

var filter = [
    "category.[cars]", 
    "category.[bikes]" 
];
flexmonster.setFilter('Category', filter);

flexmonster.getFilterProperties('Category');
/*
method getFilterProperties() returns the following object, where type is 'members' and members property has 2 elements
{
  type : 'members',
  members : [
   {'caption' : 'Cars', 'uniqueName' : 'category.[cars]'},
   {'caption' : 'Bikes', 'uniqueName' : 'category.[bikes]'}
  ]
}
*/

flexmonster.clearFilter('Category');

flexmonster.getFilterProperties('Category');
/*
after clearFilter() call method getFilterProperties() returns an Object with type 'none' and empty members array
{
  type : 'none',
  members : []
}
*/

Try the example on JSFiddle.

See also

clearFilter
getFilter
setFilter
setTopX
setBottomX