DONE: Show Number of Entries in Child Tab Caption

+1 vote

I try to improve the ui (table-over-tabs) for an 1:M relationship between two tables - User : Workitem.

When I select a user entry the form below shows all relevant user information(tab1) and "hides" behind tab2 if there are any workitems (the linked table). So I have to change the tab view to see if there is even anything there.

Is there a way to show if there are any Workitems for the user without switching the tab-view?

Some ideas I came up with but didn't managed to implement:
- Show number of records in the tab caption
- Change style to other color with css on empty table


in Features (Done) by (460 points)
recategorized by

2 Answers

+1 vote

As of dbFront 1.2.2, dbFront will now automatically display a record count in the top right of any child tabs. This applies to 1-1 and 1-M relationships.

To see this in action you can try the Demo Site

by (64.3k points)
edited by
suggestion: (optionally) hide the record count for 1-1 relationships. it will always be 1 and just adds visual clutter IMO
Actually, it could be none (blank) or 1 if there is a related record.  But I am aware of the clutter potential.  Thanks for the suggestion.
Good point, that is true. In my case I have an insert trigger on the parent table that auto-populates the 1-1 child tables so it's just always 1
0 votes

"Show number of records in the tab caption"

Unless I'm misunderstanding this should be doable with a view, like

COUNT(WorkItemID) AS [CountWorkItems]

Maybe you'd want to add a description to make it more obvious what it represents in the caption, e.g.

CONCAT('# of Work Items: ', COUNT(WorkItemID)) AS [CountWorkItems]

by (2.3k points)
I think the objective is to get the total row count for the grid in the tab caption so that a user does not even need to open the tab.  That feature is coming in dbFront 1.2.2
Nevertheless thanks your reply Daniel.
Oh I think I see now, you want to customize the tab where it says "Details". Though if your goal is just "to show if there are any Workitems for the user without switching the tab-view" then I think my method would work, as the Details tab is open by default when you load the table. You could also add the total count view field in the table itself.

Either way...showing the total child records in the caption sounds useful.
Done.  You can check out the Demo site or download the beta.  Enjoy.
Realy nice. Much appreciate it.
Welcome to the dbFront Q&A site, where you can ask questions and receive answers from other members of the community.
 | Minimalist Answer Theme by Digitizor Media
Powered by Question2Answer