Skip to main content

getFilter()

Description

Returns an object with criteria specified for data filtering

Usage

getFilter(id?: string): {cell, rules};

Parameters

  • id - (optional) the id of a sheet. If not specified, the method is called for the current sheet

Returns

The method returns an object with filtering criteria. The object includes two attributes:

  • cell - a range of cells for which filtering is applied
  • rules - an array of objects with rules for filtering

Example

const spreadsheet = new dhx.Spreadsheet("spreadsheet", {});
spreadsheet.parse(data);

// gets criteria of filtering for the current sheet
const filter = spreadsheet.getFilter(); // -> {cell:"A1:A8", rules: [{…}, {…}, {…}, {…}, {…}]}

Change log: Added in v5.0

Related article: Filtering data