Manual row moving does not update row index in ColumnSettings object which is 'this' in cell validator function

Tags: #<Tag:0x00007f8b23eb9190>

Here is an example for reproducing the issue: https://jsfiddle.net/u6jghf23/10/

I use a table with data schema and arrays of objects as a data source.

Steps to reproduce:

  1. Select and move second row up
  2. Edit cell A1
  3. After editing you’ll see two alerts:
  • First with cell row index
  • Second with original object corresponding to that row

It’s not correct because row index in this case is equal to 1, but must be equal to 0 for correct matching with original data source array.

Can you help me? May be I’m doing something wrong.

I guess that I’ve figured out how it works.

ColumnSettings object has ‘row’ and ‘visualRow’ properties:

  • ‘row’ property equals to index in data source array
  • ‘visualRow’ property equals to row index in UI

There is no need to use .toPhysicalRow() function to get index in original array. Value in ‘row’ property can be used directly.

Hey @bovin.a

It’s great to see that you’ve found an answer that you were looking for. Is there anything I can help you with?

Hi, @aleksandra_budnik

Thank you for reply. My problem is solved.

Great. I guess that we can close the topic.