Last active
April 10, 2017 11:10
-
-
Save ngalluzzo/b96818b903c97affac53 to your computer and use it in GitHub Desktop.
hide empty tables in Knack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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