I need to get the value from column RR from the same raw the button is clicked
the problem here is that the code only works when i use evaluate in console in google developer tools
Table :
<div class="tableDiv" align="left">
<table id="example" class="display" align="center">
<thead>
<tr style="color: #D2002E; background: #FFCC01;">
<td >Date</td>
<td>RR</td>
<td>Origin</td>
<td>Destination</td>
<td>CNEE</td>
<td>Status</td>
<td>Details</td>
</tr>
</thead>
<tbody id="table_body">
</tbody>
</table>
</div>
data values for each row :
var rootRef = firebase.database().ref().child("Requests");
rootRef.on("child_added", snap =>{
var DateValue = snap.child("Date").val();
var RRValue = snap.child("RR").val();
var OrgValue = snap.child("Origin").val();
var DestValue = snap.child("Destination").val();
var CustAccValue = snap.child("Customer Account").val();
var StatusValue = snap.child("Status").val();
if (StatusValue != "Done")
{
$("#table_body").append("<tr><td " + DateValue +
"</td><td class=\"valueRRField\">" + RRValue +
"</td><td>" + OrgValue +
"</td><td>" + DestValue + "</td><td>" + CustAccValue + "</td><td>" + StatusValue + "</td><td><Button onclick=\"expandTriggered()\" class=\"lisnClick\">" + "details" + "</Button></td></tr>");
}
here where the code does not work only when using evaluate
$(".lisnClick").click(function() {
var refer = $(this).closest("tr")
.find(".valueRRField")
.text();
alert(refer); // Output
});