Cancelling a pending row move on manualRowMove

34 views
Skip to first unread message

matt....@gmail.com

unread,
Mar 11, 2016, 6:13:08 PM3/11/16
to Handsontable
I'm working with HandsOnTable with a simulated hierarchy (some rows are rendered differently as if they were children of the previous row). I sort the grid's data directly at the data level (not using HoT's sort functionality) to preserve my ordering. I have context menu commands that perform various operations reordering operations (move up / move down / etc.). This is easily handled by sorting the data collection using a custom sort function:

myData.sort(compareFunction)

On top of this command-based reordering, I want to provide the user with a way of manually reordering rows, including parent rows. Essentially what I want to do is to know where the user wants a row to be reordered, cancel HoT's reorder operation, perform a custom operation on my data, re-sort my data and rely on HoT to refresh the display using my new sort.

I'm bumping into some problems with the grid's internal idea of where rows are and what they represent getting out of sync with the ordering of my data and am looking for ideas to work around this problem.

Ideally, I'd like to cancel every move operation and just perform the operation on my data, but I don't see any way of previewing and cancelling a pending move operation. Has anyone else needed a way of cancelling a drop operation based on the location the row was dropped?

Alternatively, has anyone found a way of telling the grid to re-examine the data / discard its internal custom row order?

I apologize for the specialized nature of the question. Thanks for any help you can provide.

Reply all
Reply to author
Forward
0 new messages