document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll(".wpDataTable tbody tr").forEach(row => {
let ticketCell = row.querySelector("td[data-column-name='row_ticket']"); // Target the row_ticket column
if (ticketCell) {
let ticketId = ticketCell.textContent.trim(); // Get the row_ticket ID
// Create the JetEngine listing shortcode for the eye icon dynamically
let listingShortcode = `[jet-engine-listing id="62346" query="ticket_id=${ticketId}"]`;
// Insert the shortcode into the table cell
ticketCell.innerHTML = listingShortcode;
}
});
// Trigger JetPopup when clicking the eye icon
document.addEventListener("click", function(event) {
if (event.target.closest(".open-popup")) {
event.preventDefault();
JetPopup.openPopup("62340"); // Open JetPopup with ID 62340
}
});
});