Interface FilterBehaviorOptions

Hierarchy

  • FilterBehaviorOptions

Properties

clearSelectionOnFilter?: boolean

Flag that controls whether or not to clear out selected rows when the filter changes Defaults to false

filterExcludeObjectsWithoutMatchField?: boolean

By default, for hierarchical datagrids, when there is a object that does not have the property being searched for, these objects are included in the filter match. Set this flag to true to exclude such objects

globalFilterMatchFunction?: ((item: unknown) => boolean)

Type declaration

    • (item: unknown): boolean
    • Function to control all the filtering at all levels. If you specify this, It runs before any other filtering. If you return true, it means the item matches the filter. If you return false, it means the item does not match the filter and no other filtering will be done. This allows you to have full control over filtering.

      Example

      globalFilterMatchFunction: (item: unknown) => {
      const anniversary = anniversaryRef.current?.value;
      if (anniversary === "Select" || anniversary === "" || anniversary === undefined)
      return true;
      const hireDate = resolveExpression(item, "hireDate");
      if (!hireDate)
      return false;
      const dr = getDateRange(anniversary as DateRangeType);
      const hireAnniversary = new Date(new Date().getFullYear(), hireDate.getMonth(), hireDate.getDate());
      return hireAnniversary >= dr.start && hireAnniversary <= dr.end;
      }

      Property

      Default

      null

      See

      https://www.reactdatagrid.com/examples?example=Filter_Options

      Parameters

      • item: unknown

      Returns boolean

hideIfNoChildren?: boolean

Flag to control whether or not an item that has no children is filtered out or not.

Default

false

Generated using TypeDoc