Refresh tab count

  • 1
  • Problem
  • Updated 2 years ago
  • In Progress
I have a tab set with a count label referencing a model.  How do I make this refresh when additional rows are added to each of the models.  I can do it for a table, just not for these tab labels?

Photo of Chris Mollan

Chris Mollan

  • 570 Points 500 badge 2x thumb

Posted 2 years ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Photo of Chris Mollan

Chris Mollan

  • 570 Points 500 badge 2x thumb
Thanks, how is this added in.  For example, I have javascript to refresh the model at intervals - can I add this line into here?  Where exactly would it go?

(function(skuid){    var $ = skuid.$;
    $(function(){
        var myModel = skuid.model.getModel('teaminbox');
        var waitTime = 3000;
        setInterval(function() {
            myModel.updateData();
        }, waitTime);
        
    });
})(skuid);
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
I would assume that you could add it right into this script but I don't write much code, so I'm not sure the best place/format to put it.
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
In the upcoming Brooklyn release, global merges, such as {{$Model.Account.data.length}} will automatically update when the number of records in a Model changes. This will cause the number of records you're showing in your Tab labels to automatically update when the number of records in the Model whose data is shown in a tab is changed.
Photo of Chris Mollan

Chris Mollan

  • 570 Points 500 badge 2x thumb
Any idea when this might be released?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Brooklyn will be GA in November.