Skip to content

Instantly share code, notes, and snippets.

@guiszytko
Created March 23, 2021 20:55
Show Gist options
  • Save guiszytko/d324c35705f23d78e273ddf0b38232c7 to your computer and use it in GitHub Desktop.
Save guiszytko/d324c35705f23d78e273ddf0b38232c7 to your computer and use it in GitHub Desktop.
funçao recebendo undefined
function recuperaTipoEndereco(teste){
debugger;
let tipoEnderecos = $('#tipoEndereco_hidden').val()
TIPOENDERECOS = JSON.parse(tipoEnderecos);
TIPOENDERECOS.map((v, index) => {
if (v.id == teste){
return v.nome;
}
});
return
};
function montaTabelaEndereco() {
debugger;
let html = "";
let teste = "";
ENDERECOS.map((v, index) => {
recuperaTipoEndereco(v.tipoEnderecoID);
html += "<tr>";
html += "<td>" + teste + "</td>";
html += "<td>" + v.cep + "</td>";
html += "<td>" + v.logradouro + "</td>";
html += "<td>" + v.cidade + "-" + v.uf + "</td>";
html += "<td><a href='#!' onclick='editar(\"" + index + "\");'>" +
"<i class='btn btn-orange500'>editar</i></a>" +
"<a href='#!' onclick='deleteEndereco(\"" + index + "\");'>" +
"<i class='btn btn-red'>Apagar</i></a></td>";
html += "</tr>";
})
$('#tbody-endereco').html(html);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment