I'm making a checklist and I need the information to be saved in the database as I tick the radio button. I believe I should do it with Ajax. Can anyone guide me? Thanks
Auto Save Edit Grid
-
- User
- Posts: 47
In: Server Events / Global / All Pages / Api_Action, i have create a script....
// API Action event
function Api_Action($app){
$app->get('/CheckList/{Relatorio}/{Questao}/{Valor}', function ($request, $response, $args){
$Relatorio = $args["Relatorio"];
$Questao = $args["Questao"];
$ValorClicado = $args["Valor"];
$myResult = ExecuteStatement("UPDATE tb_itensavaliados SET Resultado='{$ValorClicado}' WHERE CodRel= {$Relatorio} and CodQuetoes= {$Questao}");
return $response;
});
}
I thought of calling it in Edit Tag Client side events... but I don't know how... the path is: /api/CheckList/1/9/BA
-
- User
- Posts: 47
sorted out!!!!
to call the api I put it in Edit Tag / Client side events:
{ // keys = event types, values = handler functions
"change": function(e) {
var $parameter1 = "xxxxx";
var $parameter2 = "xxxxx";
var $parameter3 = "xxxxx";
fetch("./api/CheckList/" + $parameter1 + "/" + $parameter2 + "/" + $parameter3);
}
}