What I would like to do is display a badge showing the number of buttons left to complete. This would help the user to see that there may be buttons below the ‘horizon’ of the viewport of smaller screen sizes.
The show/hide at the moment is based on the table’s id that is not empty. As the above image indicates, the green button indicates the page needs to be completed, when clicked will take the user to the insert page. The blue button indicates the page is completed and the link, when clicked, will lead the user to the update page.
Hi.
Assuming your table is generated from a server connect and repeat region, and there is a field which is being used to determine whether to show blue or green button… You can apply filter on the server connect source data using where , with property is same used for buttons, and value would be the one used for green color.
Then, you can use count function to get number of pending (green) tasks. It would look something like this: serverConnect1.data.where(task_status, 'pending', ==).count()
This code can be set up using visual picker on the badge’s dynamic attribute - value/text.
Thank you Sid, your comment has given me a better understanding of other options. Your suggestions are welcomed…
Take a look at the code below that I am using for the buttons, and you can see that I am using the table ‘ms_app_id’ determine the status of each task.
Unfortunately, the series of tasks are not within a single table. The data of each questionnaire of the application is held in its respective table. The status of that questionnaire is displayed in a bootstrap card. Each task queries whether the ‘ms_app_id’ from its table exists.
But from the code you have shared.. it seems you are using the FIELD (not table) ms_app_id to determine whether to show blue or green buttons.
This would work for getting the count too.
sc_ms_app_progress.data.ms_app_0_4_02_spouse.where(ms_app_id, null, ==).count()
Use the visual picker in dynamic attribute value of badge to build out the code which would be similar to above. Make sure to make the condition which suits your case.. id==null or id>0 or id==true.