Before we get into how you can do the sum for all items in the list, whether or not they are shown, let's briefly talk about why you actually might not want to do that.
If you do not sum all the items in the list, but only sum the items shown, you preserve the ability to show different sums depending on how the view has been filtered. This may be valuable information for your users. In the example you linked to, it showed 4 projects, the calculated column "Total Billing" for each project, and then the sum of the "Total Billing" for all 4 projects. What if there was another column we are not seeing called "Region", and those 4 projects were visible because the user had filtered by one region. It's perfectly plausible that a user might say "I want to see the total billing for Region X," come to the list, filter by Region to see the projects for that region, and then want to see the sum total of all the Total Billing values for all those projects.
If you always show the sum for all items in the list, you lose that ability.
That being said, if you did want to always show the sum for all items in the list (visible or not), I would just set up an async call in OnPostRender
(either using JSOM or REST, personally I am preferring REST these days) to get the Total Billing values for all list items, and then when you get that response, add them together and display the resulting sum.
You almost don't even need to hook into the CSR system to do that, you could just set up your JSLink to pull in jQuery and another file where you do everything in $(document).ready()
.
(And of course you don't even really need to use jQuery, but like I said, I have been preferring REST these days and jQuery's $.ajax()
makes those calls pretty easy to do.)