API reference
Table of contents

setFilter

setFilter(uniqueName: String, filter: FilterObject)

[starting from version: 1.4]

Sets the filter for the specified field.

Parameters

Parameter/Type Description
uniqueName
String
The field’s unique name.
filter
FilterObject
Contains filtering information.
Note that filter.members, filter.exclude, and filter.include filters do not apply if the field contains one member.

Examples

1) If you want to see data for certain field members, specify them in the members property:

flexmonster.setFilter("Country", 
  {
    "members": [
      "country.[poland]",
      "country.[uk]",
      "country.[ukraine]",
    ]
  }
);

Try the example on JSFiddle.

2) If you want to hide certain field members, specify them in the exclude property:

flexmonster.setFilter("Category", 
  {
    "exclude": [
      "country.[australia]",
      "country.[japan]",
      "country.[norway]",
      "country.[sweden]",
    ]
  }
);

Check out the example on JSFiddle.

See also

clearFilter
getFilter