• Syed Shadab Sajid
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I'm trying to print content inside a div as below.
 
printPreview: function(component, event, helper) {
    	//window.print();
        
        
	   var divToPrint=component.find("printableDiv");
	   console.log('divToPrint.outerHTML: '+JSON.stringify(divToPrint.innerHTML));
	   newWin= window.open("");
	   newWin.document.write(divToPrint.outerHTML);
	   newWin.print();
	   newWin.close();
},

But this did not work. Anyone got a working example to print within Lightning components please. Appreciate any help. Thanks.