Skip to content

Request to be able to decide whether a reorder should be done. #26

@ds-martinso

Description

@ds-martinso

In line 670 of index.es.js we have:

 // run all reorder events
if (mode && mode === DragMode.SWAP) {
    this.reorder.forEach(function (o) {
        return cols[o.a] = cols.splice(o.b, 1, cols[o.a])[0];
    });
} else {
    // mode: reorder - default
    this.reorder.forEach(function (o) {
        return cols.splice(o.a, 0, cols.splice(o.b, 1)[0]);
    });
}

Based on what I have seen and tested, this is what causes the reordering.
Would it be possible add a conditional prop so that we can decide ourselves whether we want to reorder?
I know the use case of this can be quite specific and rare. But in my use case, I want to handle the reordering myself, and update the table with my own reordering.
If I do so now, this library will do a double reordering because I am updating the table with my new order of columns.
If I comment out the code above, there will not be a double reordering and instead, only my own reorder will count.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions