Handsontable: [3.0.0.+] After sorting column, VisualRowId lookup fails in options.cells fn

Created on 7 Oct 2018  路  3Comments  路  Source: handsontable/handsontable

Description

From inside the constructor's cells function, this call:

this.instance.toVisualRow( row )

returns null after the 3rd consecutive sort of a given column.

At page load the column is unsorted, or rather, is default sorted. Click 1 on its header sorts the table by the column as expected. Click 2 on its header re-sorts the table by the column as expected. Click 3 on its header returns the table to -- what? -- its original load order, I suspect.

The code return a VisualRowIndex after the 1st and 2nd sort, but fails to do after the third sort.

I expect that it should always return a VRI.

Steps to reproduce

Detailed steps are included in the demo.

Demo

Sorry, I can't use Jsfiddle nor Codepen. Here is a link to the annotated test case:

https://s3-us-west-2.amazonaws.com/cssian-github/testcase.html

Your environment

  • Handsontable version: 6.01 pro w/o license from cdn
  • Browser: Version 69.0.3497.100 (Official Build) (64-bit)
  • Operating System: MacOS 10.13.6
Column sorting Regression Bug

All 3 comments

Thank you for reporting and investigating this case.

I have created a simple demo that logs this.toVisualRow(0) and it returns null on the 3rd sorting for the same column.

nextgif

The null value appears in the v 3.0.0, where we made a couple of breaking changes for the columnSorting plugin but as this behavior haven't been described in the notes I mark it as a bug.
Release notes: https://docs.handsontable.com/pro/3.0.0/tutorial-release-notes.html

@AMBudnik Thanks for looking into this. :)

Fixed with #5446 and released in v6.2.0

Was this page helpful?
0 / 5 - 0 ratings