vue-excel-editor icon indicating copy to clipboard operation
vue-excel-editor copied to clipboard

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

Open ZPiDER666 opened this issue 1 year ago • 1 comments

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 avatar Mar 19 '23 22:03 ZPiDER666

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
   },
...}

ZPiDER666 avatar Mar 19 '23 22:03 ZPiDER666