Once you find the ID, copy and paste the following code into the JavaScript section of your page.
TB.render('component_3',function(data){
var number = parseInt(data.ele.find('.t-records-button').text());
data.ele.find('.t-records-button').text(number + ' Projects');
});
Change component_3 to the ID of your component and the “Projects” text to any custom text you would like.
Hey Chem,
Hope you are well - worked perfectly in table mode, I didnt have quite the same success in a list view (I get NaN) - any pointers?
TB.render(‘component_20’,function(data){
var number = parseInt(data.ele.find(‘.btn-sm’).text());
data.ele.find(‘.btn-sm’).text(number + ’ Customers’);
});
This works for me… sort of…
If I add the code to my Events table, for instance, it will show the number of Events alright. But then I navigate via a menu to a page that does not have any such code - like a page that shows a table of Countries, for instance – that page of Countries says 52 Events. It seems like I need to add this type of code to every page that has a table component or add it to none at all. Only if I refresh the page, will the correct label show up. Am I missing something?
I ran into other problems where changing the label from, say, “50 records” to “50 Events” looked good until I clicked a Filter Tab. Then my count was off, although the count is correct with the default “50 records” it is not correct when the deafult label is changed…To remedy this, looking further, I found posts to simply hide the count, but yet hiding table actions removes pagination, refresh and other things I need. …Is there some CSS to simply remove the record count and only the record count? And if remove the record count (default or not), when I open my Event Schedule with Group Bys on Year/Month, I still get “Counts” on each Group, which is another level of complexity. How do I simplify all this? Ideas? Thanks
Hey @tbf, I believe this is caused when you have the same component ID on the destination page. I’m going to look into this more and will respond here with any updates.
For working with Filter Tabs, you’ll need to update the code to the following. I’ve also added an option so that when the Count is “1” it will display “1 Project” instead of “1 Projects”.
@Chem Upon further inspection it appears it has nothing to do with which tab, I believe the problem shows up when the pagination is in play. If the pagination is displayed then it shows duplicate records count.