gpt4 book ai didi

extjs - 如何打印ExtJS组件?

转载 作者:行者123 更新时间:2023-12-02 22:10:09 26 4
gpt4 key购买 nike

如何弹出“打印”对话框,在确定后打印出组件?

最佳答案

                    var targetElement = Ext.getCmp('PrintablePanelId');
var myWindow = window.open('', '', 'width=200,height=100');
myWindow.document.write('<html><head>');
myWindow.document.write('<title>' + 'Title' + '</title>');
myWindow.document.write('<link rel="Stylesheet" type="text/css" href="http://dev.sencha.com/deploy/ext-4.0.1/resources/css/ext-all.css" />');
myWindow.document.write('<script type="text/javascript" src="http://dev.sencha.com/deploy/ext-4.0.1/bootstrap.js"></script>');
myWindow.document.write('</head><body>');
myWindow.document.write(targetElement.body.dom.innerHTML);
myWindow.document.write('</body></html>');
myWindow.print();

将您的 extjs 可打印组件写入文档中。

关于extjs - 如何打印ExtJS组件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5939456/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com