I have the following code in a grid application:
onScriptInit:
?>
<script src=’<?php echo sc_url_library(‘prj’, ‘jquery’, ‘jquery-3.3.1.min.js’); ?>’></script>
<script src=’<?php echo sc_url_library(‘prj’, ‘inlinegraph’, ‘jquery.sparkline.min.js’); ?>’></script>
<script>
window.onload=function() {
$(’.inlinesparkline’).sparkline(‘html’, { type: ‘line’, width: ‘150’, height: ‘50’} ) }; </script>
<?
and in: onRecord:
$resultado1= array();
$check_sql = “SELECT resultv2.resultado_num, psoli.id_nbu, prot.no_hc, prot.fec_prot FROM protocol prot INNER JOIN practicas_solicitadas psoli ON prot.no_prot = psoli.no_prot INNER JOIN resultados_v2 resultv2 ON psoli.id_prac_solic_pk = resultv2.id_prac_solic_fk WHERE (psoli.id_nbu = '” . {resultados_v2.id_nbu_fk} . “’) AND (prot.no_hc = '” . {paciente.no_hc} . “’) AND (resultv2.resultado_num > ‘0’) ORDER BY prot.fec_prot”;
sc_select(rs1, $check_sql);
f ({rs1} === false) {
$list_resultado= “1,2”; }
else {
while(!{rs1}->EOF) {
$resultado1[]= {rs1}->fields[0];
{rs1}->MoveNext();
}
{rs1}->Close();
list_resultado= Implode(",", $resultado1); }
{grafico}="<span class=‘inlinesparkline’>" . $list_resultado . “</span>”;
my question is, why the javascript code runs only at the beginning of the grid (look at the graph in the last column, page_1.png) and not in the navigation (page_2.png), thanks for now