Should a post-doc let his boss know before applying for a short term funding involving working in another location There are some fundings which support early-career researcher by letting him to work/visit another institute/university for few months. Those fundings normally pay for travel and accommodation expenses (not living expenses) and require a candidate to be affliated of one organisation, e.g. to be a post-doc.

My question is that if a researcher who wants to apply for those fundings should let his boss, whose funding is paying his salary, know before applying or after knowing that his application is successful.
Absolutely let them know before you apply. At my university, postdocs can't PI projects without a special exception from the university anyway, so you would need a support letter from your boss to apply in the first place. These kinds of rules probably don't apply to the kind of funding you are seeking since the money will go to you directly rather than being funneled through your current institution. However, if you are going to leave the group for a few months during your time there, your current boss needs to know this. Also, they should be glad to have you go and spend time with another group where you will undoubtedly get additional training and/or facilitate connections between your current group and the remote one. As such, your current boss might be able to help you write the funding application.