0
I call this function which returns me a list and populates a table in the view, updating every time I pass a parameter through the filter. Everything works perfectly, just need to put paging, because has search that returns more than 100 lines. I did a lot of research, but I was not right to use the pluggins. I really wanted to just implement what is already done.
function CarregaGridCliente(representante, vendedor) {
$("#tbl > tbody").empty();
$.ajax({
type: "GET",
url: "/Representantes/Clientes/Listar",
mtype: 'GET',
async: false,
datatype: 'json',
data: { representante: representante, vendedor: vendedor },
success: function (data) {
$.each(data, function (i, element) {
$("#tbl > tbody").append(
"<tr>" +
" <td>" + element.A1_COD + "</td>" +
" <td>" + element.A1_LOJA + "</td>" +
" <td>" + element.A1_NOME + "</td>" +
" <td>" + element.A1_CGC + "</td>" +
" <td>" + element.A1_MUN + "</td>" +
" <td>" + element.A1_TEL + "</td>" +
"</tr>"
);
});
}
});
}
This can be implemented on the server side. List (Representatives/Clients/List)?
– Ricardo Pontual
If you want to do it on the client side (which wouldn’t be interesting since you returned all the data), you can use the Datatables: https://datatables.net/
– Ricardo Pontual
public Jsonresult List(representative string, seller string) { var listRecourse = Dao.Get(representative,seller). Tolist(); Return Json(listRecourse, Jsonrequestbehavior.Allowget); }
– Danielle Arruda torres
i already tried using datatables.net . I couldn’t adapt with the code I programmed
– Danielle Arruda torres
Please insert the comment with the code of the List method in the question to make it clearer
– Ricardo Pontual