Grid reordered values

Hello,

I have an application that uses the Grid and has the setColumnReorderingAllowed() set as true. The drag and drop reordering works fine but I would like to be able to persist the changed values to a database. Unfortunately, I cannot find a way to access the reordered values of the Grid… I’ve tried adding a ColumnReorderHandler but it’s not recognised.

Does anybody have an idea of how to do this?

Thanks!
Thalia

Following code works for me:

grid.addColumnReorderListener((event) -> { if (!event.isUserOriginated()) { return; } Object arr = getVisibleColumns(); config.setColOrder(arr); log.info("column reorder event"); this.save(); }); and:

    public Object getVisibleColumns() {
        List<Column> columns = grid.getColumns();
        Object ids = new Object[columns.size()]
;
        for (int i = 0; i < ids.length + 1; i++) {
            ids[i]
 = columns.get(i).getPropertyId();
        }
        return ids;
    }
[/i]

Agata

[i]

[/i]