Skip to content

Instantly share code, notes, and snippets.

@ngalluzzo
Last active April 10, 2017 11:10
Show Gist options
  • Save ngalluzzo/b96818b903c97affac53 to your computer and use it in GitHub Desktop.
Save ngalluzzo/b96818b903c97affac53 to your computer and use it in GitHub Desktop.
hide empty tables in Knack
// target a specific scene / page
$(document).on('knack-scene-render.scene_130', function(event, scene) {
scene.views.map(function(view) { // go through each scene view
if(Knack.models[view.key].data && Knack.models[view.key].data.length < 1) { // if view has row data AND that data is 0...
$('#' + view.key).remove(); // remove this specific view
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment