Total row in Scout Eclipse

116 views Asked by At

I want to add total row in Table in scout eclipse.

I know that I can add new row and add sum at the end but what I want is that row will float at the bottom of table.

This mean that total would not be last row but always at the bottom. (even if there is only one row).

1

There are 1 answers

1
nrainer On

You can add a row and calculate the sum after having imported the table data (eg: in execLoadData).

In order to keep the row at the bottom, add a non-displayable column of the type AbstractIntegerColumn and add the lowest sort index 0. Then, fill the values of all regular rows with 0 and the value if the sum column with 1.

@Order(5.0)
public class SortColumn extends AbstractIntegerColumn {

  @Override
  protected boolean getConfiguredDisplayable() {
    return false;
  }

  @Override
  protected int getConfiguredSortIndex() {
    return 0;
  }
}