ewoytowitz
04-04-2024Cloud Apps
Is there a way to change the display order of the data options in a MemberFilterTile?
I am using the MemberFilterTile component from @sisense/sdk-ui. In some cases, I want the options I'm seeing to be displayed in a different order. Is there a way to change the order in which the options are displayed? For example, in this Competition Year filter I would want the most recent year displayed first, instead of last (DESC instead of ASC order).
Yes, you can. You need to sort an Attribute that you are using for this filter.
For example:
import { filterFactory, Sort } from '@sisense/sdk-data'; const sortedYearsAttribute = DM.Commerce.Date.Years.sort(Sort.Descending); const filter = filterFactory.members(sortedYearsAttribute, ['2013-01-01T00:00:00']); //... return ( <MemberFilterTile title={'Year'} attribute={sortedYearsAttribute} filter={filter} /> )