I am able to not display a table when it is empty I would like to display a view (view_217) at the same time and not display it when the table has data. Here is the code I tried, but it doesn’t work
$(document).on(‘knack-scene-render.scene_5’, function(event, scene) {
// Loop through each scene view, on the page.
scene.views.map(function(view) {
if(Knack.models[view.key] && Knack.models[view.key].data && Knack.models[view.key].data.length < 1) {
// Remove the specific view.
$(’#’ + view.key).remove(); $(’#view_217’).show();
}
if(Knack.models[view.key] && Knack.models[view.key].data && Knack.models[view.key].data.length > 1) { $(’#view_217’).remove();
}
});
});