Hello, I have two statements in jQuery that I use for:
- Checking a checkbox
- Disable a radio button.
The question is that these instructions run by the system does not work, but if I pick it up and play in the browser console everything happens correctly
jQuery
$.ajax({
url: addressWebService+'auditoriaexcecao/getAuditorias/audi_id/'+audi_id,
type: 'get',
dataType: 'json'
}).done(function(r){
if(r.length >= 1){
var hora;
$.each(r, function(i, obj){
hora = obj.auex_hora.split(":");
hora[0] = hora[0] != '10' ? hora[0].replace("0", "") : hora[0];
var processo = obj.auex_proc_id == 1 ? "smt" : "";
/*Eu dei o console.log para ver oq estava sendo executado, se eu pegar o que printou no console, e executar por lá mesmo, funciona*/
console.log("$(\".div-pai[data-proc-id='"+obj.auex_proc_id+"']\").find(\"#tab"+hora[0]+processo+"\").find(\".check-ignorar-horario\").attr('checked', true);");
console.log("$(\".div-pai[data-proc-id='"+obj.auex_proc_id+"']\").find(\"#tab"+hora[0]+processo+"\").find(\".chck\").attr('disabled', 'disabled');");
/*Estas são as duas instruções que não funcionam*/
$(".div-pai[data-proc-id='"+obj.auex_proc_id+"']").find("#tab"+hora[0]+processo).find(".check-ignorar-horario").attr('checked', true);
$(".div-pai[data-proc-id='"+obj.auex_proc_id+"']").find("#tab"+hora[0]+processo).find(".chck").attr('disabled', 'disabled');
});
}
});
Can anyone see some error I'm not seeing?