0
I have a table, which lists driver data, that when clicking a column of the table a modal is triggered.
But I want, when clicking, to be called a function, which returns the modal, and not every time I load the page, already load the modal.
Just follow the code.
That way, it works perfectly, but it’s getting too slow, that’s why I want to know if there’s like,data-target
pass a function calling the modal
<?php
if($PERMOT != 0)
{
echo "<td><a data-toggle='modal' data-target='#modal-$i'>".number_format($log[0], 3)."</a> </td>";//Gasto
echo "<td class=".$classTd."><a data-toggle='modal' data-arget='#modal-$i'>".number_format($log[5], 3)."</a></td>";//Diff
}
else
echo "<td><div>-</div><div>-</div><div>-</div></td>";
echo "</tr>";
echo "</tbody>";
echo "
<div class='modal fade' id='modal-$i'>
<div class='modal-dialog modal-lg'>
<div class='modal-content'>
<div class='modal-header'>
<h4 class='modal-title'>Documento ".$CODFIL."-".$SERDOC." - ".$NUMDOC." </h4>
</div>
<div class='modal-body'>
".$log[6]."
</div>
<div class='modal-footer'>
<button type='button' class='btn btn-danger' data-dismiss='modal'>Fechar</button>
</div>
</div>
</div>
</div>
";
//echo "<button class='info plus ' id='".$i."' onclick='moreInf($i, $CODFIL, $SERDOC, $NUMDOC)'></button>";
$i++;
?>
Check if the example of this code helps you: https://answall.com/questions/239981
– Laércio Lopes
People come in here and dump any code and think they’ll succeed to their problem. When you ask about a problem in your code, you’ll get better answers if you give people code that they can use to reproduce the problem. https://answall.com/help/mcve
– user60252
Another good practice is to mark an answer as accepted if it solved or helped solve your problem.
– user60252
Sorry young man, I’m still learning how to use this tool. You’re not obliged to help if you don’t want to,.
– Thiagão