I have a problem, what I want that is through an ajax can get a number of values and make a tour in my datatable that has a checkbox column, and if the value of that checkbox is equal to the value brought by ajax to be checked:
$.ajax({
url: "/Guias/ListaEquiposGuia",
type: "GET",
data: { TipGuia: TipGuia, CodGuia: CodGuia },
success: function (data) {
var E = JSON.parse(data)
//var table = $('#table').datatable();
table.$('input[type="checkbox"]').each(function () {
$.each(E, function (i, item) {
if ($('input[type="checkbox"]').val() == item.CodEquipo)
$(this).prop('checked', true);
});
});
}
})
You can tell me what I'm doing wrong, Ajax brings me a list of values.