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,


  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


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). 

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 
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