Print function html doby

QuestionsPrint function html doby
C3media asked 8 years ago

Hello,

I have this code to print window…

$(document).ready(function() {
$('ul#tools').prepend('<li class="print"><a href="#print">Click me to print</a></li>');
$('ul#tools li.print a').click(function() {
window.print();
return false;
});
});

it's working fine.

It´s possible to print HTML into function, so as window.print be called after the on_after_update method, non using link?

Thanks

4 Answers
C3media answered 8 years ago

Hello,

I have found this code…

<html>
<head>
<script language="javascript">
function printdiv(printpage)
{
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = document.all.item(printpage).innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = headstr+newstr+footstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
</script>
<title>div print</title>
</head>
<body>
//HTML Page
//Other content you wouldn't like to print
<input name="b_print" type="button" class="ipt" onClick="printdiv('div_print');" value=" Print ">

<div id="div_print">

<h1>The Div content which you want to print, this use row data in diferents var to print</h1>

</div>

</body>
</html>

Idea is to print data of the row when click or on_after_update method.

Thanks by your help

C3media answered 8 years ago

For example:

In action Col, there is a Print button to open Print dialogue with dinamic data taken from Row.

Thanks again!

C3media answered 8 years ago

Closed, thanks by your help Abu!

Your Answer

1 + 17 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?