I am using simple js function to print the html of the Angular search 
results div to printed using window.print.
I am seeing issues with the alignment of the table in the print preview as 
well as print.

Tried adding all the required js and css for the angular grid.

Js:

/*Printing Library Search results*/
function printLibSearch() {
var mywindow = window.open('', 'Library Search', 'height=400,width=600');
mywindow.document.write('<html><head><title>Library Search 
results</title>');
/*optional stylesheet*/ 
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/style.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/ng-grid.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/media.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/chosen.css">'); 
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/datepicker.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/messages.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/demo_table_jui.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/dropzone.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/bootstrap.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/demo_page.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/demo_table_jui.css" />');
mywindow.document.write('<link rel="stylesheet" type="text/css" 
href="/css/jquery-ui-1.8.4.custom.css" />');
mywindow.document.write('</head><body >');
mywindow.document.write($('.gridStyleLib').html());
mywindow.document.write('</body></html>');
mywindow.print();
//mywindow.close();
return true;
}

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to