Created
March 8, 2018 17:44
-
-
Save edujr1/9885e33a7ae6adfe3ea5ca5a4fb9e56c to your computer and use it in GitHub Desktop.
Valida se possui algum campo preenchido no filtro de pesquisa . Não se aplica para listas
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
/* Usado para validar o filtro de busca antes do ajax */ | |
/* Caso o 'filtroIsVazio == false', o codigo pode realizar cosulta, caso contrario, exiba uma mensagem de alerta para preencher o filtro */ | |
var filtroIsVazio = true; | |
for (var [key, value] of Object.entries(filtroObject)) { | |
if (value !== null && value !== undefined) { | |
if (value.trim() != '') { | |
filtroIsVazio = false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment