Falcon Space. The counters component



There are some entities. You can add some digital data to them (counters). 
For example, in projects, this may be the number of issues that are not closed. For orders, this is the number of new messages.
For implementation we use the following markup:
 <div class="as-counter" data-code="lead" data-itemid="1"></div> 

You also need to implement a stored procedure for each unique code counter_{code}_getValues

The example of thr procedure: 
CREATE PROCEDURE dbo.counter_lead_getValues
   @username NVARCHAR(255) = NULL,
   @itemIDs NVARCHAR(MAX) = NULL

AS 
BEGIN

  DECLARE @code NVARCHAR(255) = 'lead'

  SELECT Value AS itemID INTO #itemIDs
  FROM split(@itemIDs, ',')
  WHERE (Value IS NOT NULL) AND (Value > '')

  SELECT '' AS Msg, 1 AS Result

  SELECT @code AS Code,
         'success' AS Type,
         it.itemID AS ItemID,
         it.itemID AS Value  
  FROM #itemIDs AS it

END

At logon: current userusername и itemIDs - itemID separate by comma. 
Output: modelCode, Type (sets the color badge - success,warning, info и т.д.),ItemID,Value (what is output on badge). 

Note:
1. If you need to call custom counter initialization somewhere (for example, there is a new markup on the page), we use it in the JS callback 
as.counter.initCounters(cont);
2. In the right menu, you can also specify some numeric values next to each item in the menu. for this, see settings GetLayout. 
Falcon Space is a functional web development platform on a narrow stack MS SQL/Bootstrap. Falcon Space Gettting started
{sp-shortDemostandLinks}