263
| <![CDATA[<script>
$(function() {
var nav = $('#menuRelatorio');
$(window).scroll(function() {
if ($(this).scrollTop() > 150) {
nav.addClass("menu-fixo");
$('body').css('padding-top', 70);
} else {
nav.removeClass("menu-fixo");
$('body').css('padding-top', 0);
}
});
});
function datatable(table, title, subtitle, colorheader) {
var doc = new jsPDF("l", 'pt', 'letter');
var res = doc.autoTableHtmlToJson(document.getElementById(table));
var header = function(data) {
doc.setFontSize(14);
doc.setTextColor(40);
doc.setFontStyle('normal');
//doc.addImage(headerImgData, 'JPEG', data.settings.margin.left, 20, 50, 50);
doc.text(title, data.settings.margin.left, 40);
doc.text(subtitle, data.settings.margin.left, 60);
};
var options = {
beforePageContent: header,
startY: doc.autoTableEndPosY() + 80,
margin: {
top: 80
},
theme: 'grid',
headerStyles: {
fillColor: colorheader,
halign: 'center'
},
styles: {
overflow: 'linebreak',
fontSize: 8,
tableWidth: 'auto',
columnWidth: 'auto',
}
};
doc.autoTable(res.columns, res.data, options);
doc.save(table + '.pdf');
}
</script>]]>
|