Currently, I am working on developing a dynamic table that includes a button in one of its columns, which triggers a bootstrap modal. I'm a bit unsure on how to determine which button was clicked and how to populate the table accordingly. Admittedly, my experience with markups is limited. Here is what I have managed to put together:
div.span12
table.table.table-hover
thead
tr
th Patient Name
th Phone Number
th History
tbody
each pat in patients
tr
td #{pat.name}
td #{pat.phone}
if (0<pat.history.length)
td #{pat.history[0]}
else
td No history
a.btn(data-toggle="modal", href="#myModal") Launch
div.modal.hide(id="myModal")
.modal-header
button(type="button", class="close", data-dismiss="modal") x
h3 Modal Header
.modal-body
p One fine body...
.modal-footer
My goal is to replace the td #{pat.history[0]}
section with a unique identifier that, when clicked, will trigger the modal popup and display the corresponding patient
data. Any advice on how I can achieve this?