✅ You are viewing documentation for the latest version of Compose SDK.
Version:

# Function useGetFilterMembers

useGetFilterMembers(params): ToRefs< FilterMembersState >

A Vue composable function useGetFilterMembers that fetches members of a provided filter.

Those members can be used to display a list of members in a third-party filter component.

# Parameters

Parameter Type Description
params MaybeRefOrWithRefs< GetFilterMembersParams > The parameters for fetching filter members, supporting reactive Vue refs.
Includes the filter to fetch members for, optional default data source, parent filters, and count.

# Returns

ToRefs< FilterMembersState >

# Example

How to use useGetFilterMembers within a Vue component:

<script setup>
import { ref } from 'vue';
import { useGetFilterMembers, filterFactory } from '@sisense/sdk-ui-vue';
import * as DM from './data-model';

const filter = ref(filterFactory.members(DM.Country.Country, ['United States', 'Canada']));

const { data, isLoading, isError, isSuccess, error, loadMore } = useGetFilterMembers({
  filter,
  // Optional parameters
  defaultDataSource: 'Sample ECommerce',
  parentFilters: [],
});
</script>

The composable returns an object with the following reactive properties to manage the filter members state:

  • data: The filter members data containing selectedMembers, allMembers, excludeMembers, enableMultiSelection, and hasBackgroundFilter.
  • isLoading: Indicates if the filter members fetching is in progress.
  • isError: Indicates if an error occurred during filter members fetching.
  • isSuccess: Indicates if the filter members fetching executed successfully without errors.
  • error: Contains the error object if an error occurred during the fetching.
  • loadMore: Function to load more data rows.

This composable facilitates integrating Sisense filter members fetching into Vue applications, enabling developers to easily manage filter member states and dynamically adjust parameters based on application needs.