Forum Discussion

ewoytowitz's avatar
ewoytowitz
Cloud Apps
04-04-2024
Solved

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 opti...
  • IvanBiletskyi's avatar
    04-05-2024

    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}
      />
    )