b.tel
(Berend Tel)
February 20, 2020, 4:27pm
#1
Hi,
Is there any possiblity to show content in an empty table? So something like this:
Buttons and stuff would not be necessary but the option to show a hint to the user would be very nice.
I could imagine adding specific controls in case the table is empty but that would be a lot of work and cumbersome.
Regards,
-b
Pinyazhin
(Roman Pinyazhin)
February 21, 2020, 6:48am
#3
Hi @b.tel !
Since 7.2.0.BETA1+ we have similar functionality, see cuba-platform/cuba#1984 .
We can specify a message and a link message with a handler when Table or DataGrid does not have data.
For instacne,
<groupTable id="projectsTable"
emptyStateMessage="There is no data in table"
emptyStateLinkMessage="Click here to create new record"
dataContainer="projectsDc">
@Inject
private ScreenBuilders screenBuilders;
@Install(to = "projectsTable", subject = "emptyStateLinkClickHandler")
private void projectsTableEmptyStateLinkClickHandler(Table.EmptyStateClickEvent<Project> emptyStateClickEvent) {
screenBuilders.editor(emptyStateClickEvent.getSource())
.newEntity()
.show();
}
1 Like
b.tel
(Berend Tel)
February 21, 2020, 7:23am
#5
That’s great - wasn’t aware of that.