Arquivado
Este tópico foi arquivado e está fechado para novas respostas.
- 0
Enviar Id da minha função Js no meu botão html, possivel?
Perguntado por
Diogo Alexandre
Este tópico foi arquivado e está fechado para novas respostas.
Perguntado por
Diogo Alexandre
Ao usar o fórum, você concorda com nossos Termos e condições.
HTML :
<ul class="dropdown-menu">
<div id = "test">
<button><a id ="epicTable" class='btn btn-success teste' class="collapse-item" tabindex="-1" href="tables.html">Epic</a></button>
</div>
</ul>
Javascript :
$(document).ready(function(){
$.ajax({
url : "",
type : "get",
crossDomain: true,
dataType : "json",
success : function(data){
console.log(data);
data.forEach((epic) => {
console.log(epic.Collection)
$('#epicTable').append(`<tr>
<td>${epic.Id}</td>
<td>${epic.Collection}</td>
<td>${epic["Primavera.Common.Teams"]}</td>
<td>${epic["System.State"]}</td>
<td>${epic["System.IterationPath"]}</td>
<td>${epic["System.Title"]}</td>
</tr>`)
})
$("#txtId").val(data.Id);
$("#txtSystem.Collections").val(data.Collections);
$("#txtSystem.Primavera.Common.Teams").val(data.Primavera.Common.Teams);
$("#txtSystem.System.State").val(data.System.State);
$("#txtSystem.System.IterationPath").val(data.System.IterationPath);
$("#txtSystem.System.Title").val(data.System.Title);
},
error : function(erro){
console.log(erro);
}
});
});
Compartilhar este post
Link para o post
Compartilhar em outros sites