Sunday, May 19, 2013

Keep sorting order in Vaadin table after clear container datasource / set new container datasource

When we reset the container datasource or clear the container datasource of the table, the sorting order of the table is reset.
The work around could be using
setSortAscending(!isSortAscending()); setSortAscending(isSortAscending()); setSortAscending(!isSortAscending());
to retain the sorting order settings like before the clear/reset of datasource.

1 comment:

  1. Hi!

    Isn't it easier to just call Table.sort() after container update?
    Table memorizes last used sort properties.

    ReplyDelete