Menu
Download Free Trial
Table of contents

getFilter

getFilter(hierarchyName:String):Array

[starting from version: 1.4]

Returns the filtered members for the specified hierarchy. If data load is in progress or filter is not applied an empty Array will be returned.

Parameters

  • hierarchyName – the name of the hierarchy.

Returns

Array of filtered objects. Each object in array contains the following parameters: caption, uniqueName, and hierarchyName. It is empty if filter is not applied to the hierarchy.

Example

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

/*
method getFilter() returns the following Array
[
  {'caption' : 'Cars', 'hierarchyName' : 'Category', 'uniqueName' : 'category.[cars]'},
  {'caption' : 'Bikes', 'hierarchyName' : 'Category', 'uniqueName' : 'category.[bikes]'}
]
*/

flexmonster.clearFilter('Category');
flexmonster.getFilter('Category');

/*
after clearFilter() call method getFilter() returns an empty Array
[]
*/

Try the example on JSFiddle.

See also

clearFilter
getFilterProperties
setFilter
setTopX
setBottomX