mardi 30 mai 2017

Checkmarks don't show in checkbox on Window.print Angularjs

I am using AngularJs to display a few checkboxes. I have a click event which writes the current html to a window using document.write. However, when the new window opens for printing, none of the checkboxes are checked.

Here is the function which prints the document to the window:

  $scope.printForm = function () {
var doc = document.getElementById('myForm').outerHTML;

var myWindow = $window.open('', '', 'width=1100, height=1000');
myWindow.document.write(doc);
myWindow.print();

};

Here is the HTML for the checkboxes:

`<div ng-repeat="c in f.Choices" >
<input type="checkbox" ng-disabled="true" ng-model="c.isSelected" />&nbsp;&nbsp; </div>`

Here is what it looks like BEFORE I click "printForm"enter image description here

And here is what i looks like after I click "printForm":enter image description here

Any assistance is greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire