Hide Components when there are no Records
Please note that this is now available as a plugin for easier installation. While you can use this document as a reference, the recommended method to add this functionality is through the plugin installation wizard. Learn more about plugins here.
You can add a little JavaScript to a page that will hide a Data Component if there are no records to display.
One Easy Step
Add the following code to the JavaScript tab of your page.
TB.render('component_3', function(data) {
if (data.records === undefined || data.records.length === 0) {
data.ele.css('display','none')
}
});
Remember to change the component Id in the code to your component ID.
We'd love to hear your feedback.