Add an array in popup builder
-
Hello dear support
i want to ask how can i add an array in the pop up builder………the thing is that i have table with tablepress created with data in it……….now i want that if user click on any row of that data table the data of that row should appear in a pop up now i’ve some how created an array with the help of javascript in that array the data is passing i just want to add that array a new pop up so that the data can be dynamically change accoring to the row…………..here’s the code that i used if you need it
<script> // Assume TablePress table ID is 'tablepress-1' var table = document.getElementById('tablepress-5'); var rows = table.getElementsByTagName('tr'); // Add click event listeners to each table row for (var i = 0; i < rows.length; i++) { rows[i].addEventListener('click', function() { var rowData = []; var cells = this.getElementsByTagName('td'); // Collect data from clicked row for (var j = 0; j < cells.length; j++) { rowData.push(cells[j].innerText); } // Call function to display collected data in Popup Builder popup showDataInPopup(rowData); }); } // Function to display data in Popup Builder popup function showDataInPopup(data) { // Assuming 'showPopup' is the method in Popup Builder to display content in a popup // Replace this with the actual method or API provided by Popup Builder // For example purposes, showing an alert here alert('Row Data: ' + data.join(', ')); } </script>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add an array in popup builder’ is closed to new replies.