Tabulator: Custom sorter: `aRow` and `bRow` are undefined

Created on 25 Nov 2020  路  3Comments  路  Source: olifolkerd/tabulator

Describe the bug
In a custom sorter, the aRow and bRow parameters do not seem to be passed, even though this is described in http://tabulator.info/docs/4.9/sort -> "Custom Sorters".

Tabulator Info
4.9 (latest)

Working Example
https://jsfiddle.net/edwinvanrooij/f8x7tu03/

To Reproduce
A step by step guide to recreate the issue in your JS Fiddle or Codepen:

  1. Click on the first column to sort it
  2. Notice the undefined, undefined logs.

Expected behavior
The aRow and bRow parameters to be filled.

I would be willing to look into the issue and create a PR if that's desirable.

Thank you in advance, and a general thank you for this amazing (surprisingly extensible) library!

Possible Bug

Most helpful comment

Hey @EdwinVanRooij

I have pushed a fix for this to the master branch and will include it in this weeks patch release.

Cheers

Oli :)

All 3 comments

Confirm, I have the same behavior. I am pulling from the CDN https://unpkg.com/[email protected]/dist/js/tabulator.min.js and see the following call to the sorter function: o.modules.sort.sorter.call(this,e,t,void 0,void 0,o.getComponent(),i,n)

In sort.js you commented out the assignment of the aRow & bRow components on line 333 in function - Sort.prototype._sortRow = function(a, b, column, dir, params) Just uncommenting those should fix the issue.

Hey @EdwinVanRooij

I have pushed a fix for this to the master branch and will include it in this weeks patch release.

Cheers

Oli :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndrewHutcheson picture AndrewHutcheson  路  3Comments

andreivanea picture andreivanea  路  3Comments

alainpannetier picture alainpannetier  路  3Comments

jiaqianliCn picture jiaqianliCn  路  3Comments

aballeras01 picture aballeras01  路  3Comments