@nospamproxy/core
    Preparing search index...

    A collection of odata filters.

    Each set of filter instructions is associated with a custom element view model, so that each list filter only needs to manage it's own filters without affecting the others.

    Type Parameters

    • T
    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    listModel: ListModel<T>

    Methods

    • Set the filter instructions for the specified owner custom element view model.

      See https://www.npmjs.com/package/odata-query for supported filter types.

      Parameters

      • ownerId: string

        The custom element view model that the filters belong to.

      • disableRefresh: boolean = false

        If true, the list will not be refreshed after applying the filter.

      • ...filters: unknown[]

        The filter instructions to use. If multiple instructions are specified, the AND operation is used.

      Returns void

      class CustomListFilter {
      \@bindable public model: ListFilterModel;

      private applyFilter() {
      // Disable this filter:
      this.model.setFilter(this);

      // Apply a single filter:
      this.model.setFilter(
      this,
      { Domain: { eq: 'example.com' } }
      );

      // Apply multiple filters with "AND":
      this.model.setFilter(
      this,
      { Domain: { eq: 'example.com' } },
      { User: { eq: 'testify' } }
      );

      // Apply multiple filters with "OR":
      this.model.setFilter(this, { or: [
      { Domain: { eq: 'example.com' } },
      { User: { eq: 'testify' } },
      ] });
      }
      }