I have a click event that looks like this.
$( ".open_report" ).on( "click",function() {
console.log("on click");
//Do Stuff
});
it triggers on already created items, but not on new (dynamic) created items.
Except for the fact that the id
s differ ( which it should)
and that the data-report
tag data differ, they are the same code.
So I cant figure out why my on click event does not fire on dynamically added items.
loaded item which works
<tr id="18109599-1516219070.html" data-report="18109599-1516219070.html" class="select data-row even">
<td style="width: 300px;" data-report="18109599-1516219070.html" class="listing_cell open_report">
<div class="plCell_desktop">
<label>Discharge Summary</label>
</div>
</td>
<td style="width: 125px;" data-report="18109599-1516219070.html" class="listing_cell open_report">
<div class="plCell_desktop">
<label>17-01-2018,19:57</label>
</div>
</td>
<td style="width: 30px;" class="listing_cell">
<div class="">
<input data-report="18109599-1516219070.html" type="button" class="removeButton buttons delete_report" value="x">
</div>
</td>
</tr>
dynamically added item
<tr id="18109599-1516219273.html" data-report="18109599-1516219273.html" class="select data-row">
<td style="width: 300px;" data-report="18109599-1516219273.html" class="listing_cell open_report">
<div class="plCell_desktop">
<label>Discharge Summary</label>
</div>
</td>
<td style="width: 125px;" data-report="18109599-1516219273.html" class="listing_cell open_report">
<div class="plCell_desktop">
<label>17-01-2018,20:01</label>
</div>
</td>
<td style="width: 30px;" class="listing_cell">
<div class="">
<input type="button" data-report="18109599-1516219273.html" class="removeButton buttons delete_report" value="x">
</div>
</td>
</tr>