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

added context (name, pos) to custom sort function params #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZPiDER666
Copy link

the params of the custom sort function are only a and b, each containing the whole row object. so no sort implementation is possible, because the right name is not passed. also this.sortDir and this.sortPos are not useable because they are only set after the sort.

the params of the custom sort function are only a and b, each containing the whole row object.
so no sort implementation is possible, because the right name is not passed.
also this.sortDir and this.sortPos are not useable because they are only set after the sort.
@ZPiDER666
Copy link
Author

if you accept the PR, please also update the documentation to show something like:

... :sort="customSort" ...

{...
   customSort(a,b,n,p,name) {
      if (a[name] < b[name]) return -1
      if (a[name] > b[name]) return 1
      return 0
   },
...}

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

Successfully merging this pull request may close these issues.

1 participant