Record count on Tab (Label) not being updated

  • 1
  • Question
  • Updated 2 years ago
  • Answered
Hi There,

I have a requirement where I need to show the count of records on Tab.
So I did try like below on Tab label:

Unread ({{$Model.MasterAlerts.data.length}})


This helps me het something like :




But, the count is not getting refreshed when rows are removed from model.

How to get those counts refreshed ?
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
It won't update since the tab itself isn't registed with the model. Only registered components auto update when values change.
Photo of KVin

KVin

  • 1,158 Points 1k badge 2x thumb
Got it. 
Thanks Pat.


But in this case, can you help me understand how could I get this done so that it would auto update ?
(Edited)
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Can't do this unless you run a model aciton to a snippet to update the DOM element.
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb