Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- listarGrid();
- $('#filtrar').click(filtrar);
- });
- function listarGrid(){
- $.get('https://localhost:5001/Colaborador/Listar')
- .done(function(resposta) {
- for(i = 0; i < resposta.length; i++) {
- let dados = resposta[i];
- $('#grid').append($('<tr></tr>').attr('id', dados.id));
- $('#' + dados.id).append($('<td></td>').html(dados.id));
- $('#' + dados.id).append($('<td></td>').html(dados.nome));
- $('#' + dados.id).append($('<td></td>').html(dados.idCargoNavigation.nome));
- $('#' + dados.id).append($('<td></td>').html('R$ ' + dados.salario.toFixed(2).toString().replace('.', ',')));
- }
- })
- .fail(function(erro, mensagem, excecao) {
- alert(mensagem + ': ' + excecao);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement