Skip to content

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

Open
ZPiDER666 wants to merge 1 commit intocscan:masterfrom
ZPiDER666:patch-1
Open

added context (name, pos) to custom sort function params#130
ZPiDER666 wants to merge 1 commit intocscan:masterfrom
ZPiDER666:patch-1

Conversation

@ZPiDER666
Copy link
Copy Markdown

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
Copy Markdown
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