I'm using a Dialog Widget for generate a popup with this code in my index.php:
<button class="btn btn btn-info openObs">Deixar observação</button>
<div id="dialog" title="Dialog Title">I'm a dialog</div>
and
$("#dialog").dialog({ autoOpen: false });
$(".openObs").click(function() {
$("#dialog").dialog("open");
});
so far no problem, but i have a ajax code that generate for me this buttons in a table in other archive and echoes the result back in my index.php in a result div:
$return .= "$tabela";
while($row = mysqli_fetch_assoc($query)){
$data = str_replace('-', '/', $row['consulta_data']);
$data = date('d/m/Y', strtotime($data));
$return .= "<tr>";
$return .= "<td>" .$row['consulta_idConsulta']."</td>";
$id = $row['documento_id'];
$return .= "<td>" .$data. "</td>";
$return .= "<td>" .$row['consulta_hora']. "</td>";
$return .= "<td>" .$row['consulta_desc']. "</td>";
$return .= "<td>" .$row['profissional_nome']. "</td>";
$return .= "<td>" . "<button class=\"btn btn btn-info openObs\">Deixar observação</button></td>";
$return .= "</tr>";
}
echo $return .=" </tbody>
</table>";
The problem is, when i click on the button generated by ajax nothing happens but if I put a button manually like up there works normal.