DataTable Formatting

I’m able to display my entity into a table. The table is populated from a datasource.

  1. The table has a field called Status. Depending on the value of the status field, is it possible to change the color (e.g. green for new, red for canceled).

  2. The table has 2 number fields. Is it possible to created a calculated field.

  3. Is it possible to hide certain columns


Hello, Francis!

  1. You can see real example of table styling in our Sampler app or read about Table#setStyleProvider in documentaion.
  2. You can use Table#addGeneratedColumn() or add a field/method to your entity with @MetaProperty annotation to allow column sorting.
  3. You can use Table#setColumnCollapsed() from code to hide columns or with UI using control at top-right corner.

that’s great. Let me try that. Thanks.