Jul-05-2018, 11:47 AM
I think you'll have to do something like:
Just a start...
HTML:
{% for pdf_store in display_pdf_store %} <tr onclick='highlight()'> <form action='/download_pdf'> <td> {{ pdf_store.product_serial_number}} <input type="hidden" name="product_serial_number" value="{{ pdf_store.product_serial_number}}" /> </td> <td> {{ pdf_store.doctype}} <input type="hidden" name="doctype" value="{{ pdf_store.doctype}}" /> </td> <td> {{ pdf_store.date_time}} <input type="hidden" name="date_time" value="{{ pdf_store.date_time}}" /> </td> <td> {{ pdf_store.place_of_procedure}} <input type="hidden" name="place_of_procedure" value="{{ pdf_store.place_of_procedure}}" /></td> <td><input type='submit' id='Export' value='Export'></input></td> </form> </tr> {% endfor %}Or use JQuery to get the content of the row and pass it to the backend (AJAX?).
Just a start...
HTML:
{% for pdf_store in display_pdf_store %} <tr onclick='highlight()'> <td> {{ pdf_store.product_serial_number}}</td> <td> {{ pdf_store.doctype}}</td> <td> {{ pdf_store.date_time}}</td> <td> {{ pdf_store.place_of_procedure}}</td> <td><button type="button" value="export_pdf" class="export_pdf" /></td> </tr> {% endfor %}JS:
$(".export_pdf").click(function() { var $tds = $(this).closest("tr").find("td"); $.each($tds, function() { alert($(this).text()); }); });