Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trackBy on multiple properties #57

Closed
MiC11w opened this issue Apr 12, 2021 · 7 comments
Closed

trackBy on multiple properties #57

MiC11w opened this issue Apr 12, 2021 · 7 comments
Labels

Comments

@MiC11w
Copy link

MiC11w commented Apr 12, 2021

I need search capability to work with multiple properties. Can I use 'trackBy' for that? Or is there some other method?

@adamberecz
Copy link
Collaborator

Concatenating a string in trackBy could be a solution?

@stale
Copy link

stale bot commented Jun 1, 2021

Hi 👋 this issue has been automatically marked as stale 📌 because it has not had recent activity 😴. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jun 1, 2021
@stale
Copy link

stale bot commented Jun 4, 2021

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period.

@stale stale bot closed this as completed Jun 4, 2021
@rafalolszewski94
Copy link

rafalolszewski94 commented May 8, 2023

Coming back to this issue, since this could be a good improvement to the component.

Maybe allow users to set similar property as trackBy, like alias to be used as aliased.


Good example is search location component.

There was a spelling change from Turkey to Türkiye

I have a const that composes of few lodash utilties and creates an array for Multiselect.

export const EUROPE_COUNTRIES = [
  'Sweden',
  'Türkiye',
]

export const COUNTRY_CHOICES = intersectionBy(
  orderBy(
    EUROPE_COUNTRIES.map((c) => {
      if (c === 'Türkiye') {
        return {
          label: c,
          value: c,
          alias: ['Turkey'],
        }
      }
      return {
        label: c,
        value: c,
      }
    }),
    [(country) => country.value.toLowerCase()],
    ['desc']
  ),
  'label'
)
<Multiselect
  v-model="location"
  :options="COUNTRY_CHOICES"
  searchable
  placeholder="Select locations"
  trackAlias="alias"
/>

This might be related #314

@morrowcreative
Copy link

Is here any update please?

@adamberecz
Copy link
Collaborator

As of 2.6.3 trackBy can be an array @morrowcreative

@morrowcreative
Copy link

Thank you very much :) @adamberecz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants