alltransactsdaily
의 ID와
tbody
을 인쇄 할
작동하지 않습니다 JQuery와 인쇄 플러그인을 사용하여 사업부를 인쇄.는
여기 내 코드입니다.
<div class="col-md-9">
<input type="hidden" name="clinic_idhid" id="clinic_idhid">
<div class="table_transactions" id="table_transactions">
<table id="mytransactions" class="table table-striped table-bordered table-hover dataTable dtr-inline" role="grid" style="width: 100%;" width="100%" aria-describedby="dataTables-material">
<thead>
<th>Check-up ID</th>
<th>First Name</th>
<th>Last Name</th>
<th>Check-up Date & Time</th>
<th>Bill Amount</th>
<tbody id="alltransactsdaily">
</tbody>
</table>
</div>
</div>
<button type="button" id="btn_printdiv" class="btn btn-primary"><span class="fa fa-print"></span> Print</button>
지금 나는이 자바 스크립트를 사용하여 tbody id="alltransactsdaily"
것을 인쇄 할 :
$("#btn_printdiv").click(function() {
$("#alltransactsdaily").printElement();
});
을하고 난 버튼을 클릭하면 콘솔을 보여줍니다
jquery.printElement.min.js:26 Uncaught TypeError: Cannot read property 'opera' of undefined
at jQuery.fn.init.a.fn.printElement (jquery.printElement.min.js:26)
at HTMLButtonElement.<anonymous> (Patients_report:392)
at HTMLButtonElement.dispatch (jquery-2.2.3.min.js:3)
at HTMLButtonElement.r.handle (jquery-2.2.3.min.js:3)
jQuery 인쇄 라이브러리를 사용해야합니까, 아니면 다른 라이브러리를 열어 놓았습니까? – KevBot
@KevBot, 고마워요 감사합니다. 예, 인쇄 할 때 내 코드를 줄이기 위해 jQuery 플러그인을 사용하고 모달을 해제 할 수없는 문제를 해결하려면 –
다른 외부 라이브러리를 사용하는 것이 좋습니다. 이 라이브러리는이 PrintJob.print ('# alltransactsdaily')처럼 작동합니다. [PrintJob] (https://www.npmjs.com/package/print-job) – KevBot