UNPKG

jqwidgets-framework

Version:

jQWidgets is an advanced Angular, Vue, Blazor, React, Web Components, jquery, ASP .NET MVC, Custom Elements and HTML5 UI framework.

74 lines (71 loc) 3.94 kB
<!DOCTYPE html> <html lang="en"> <head> <title id="Description">jqxEditor has a method called "print" which allows you to Print the editor's data.</title> <link rel="stylesheet" href="../../../jqwidgets/styles/jqx.base.css" type="text/css" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta name="viewport" content="width=device-width, initial-scale=1 maximum-scale=1 minimum-scale=1" /> <script type="text/javascript" src="../../../scripts/jquery-1.12.4.min.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxbuttons.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxscrollbar.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxlistbox.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdropdownlist.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxdropdownbutton.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcolorpicker.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxwindow.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxeditor.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../../jqwidgets/jqxcheckbox.js"></script> <script type="text/javascript" src="../../../scripts/demos.js"></script> </head> <body> <script type="text/javascript"> $(document).ready(function () { $('#editor').jqxEditor({ height: 400, width: getWidth('editor'), tools: 'bold italic underline | format font size | left center right | print', createCommand: function (name) { switch (name) { case "print": return { type: 'button', tooltip: 'Print', init: function (widget) { widget.jqxButton({ height: 25, width: 40 }); widget.html("<span style='line-height: 23px;'>Print</span>"); }, refresh: function (widget, style) { // do something here when the selection is changed. }, action: function (widget, editor) { // return nothing and perform a custom action. $('#editor').jqxEditor('print'); } } } } }); }); </script> <textarea id="editor"> &lt;b&gt;jqxEditor&lt;/b&gt; is a HTML text editor designed to simplify web content creation. You can use it as a replacement of your Textarea or you can create it from a DIV element. &lt;br /&gt; &lt;br /&gt; Features include: &lt;br /&gt; &lt;ul&gt; &lt;li&gt;Text formatting&lt;/li&gt; &lt;li&gt;Text alignment&lt;/li&gt; &lt;li&gt;Hyperlink dialog&lt;/li&gt; &lt;li&gt;Image dialog&lt;/li&gt; &lt;li&gt;Bulleted list&lt;/li&gt; &lt;li&gt;Numbered list&lt;/li&gt; &lt;/ul&gt; </textarea> <div style="position: absolute; bottom: 5px; right: 5px;"> <a href="https://www.jqwidgets.com/" alt="https://www.jqwidgets.com/"><img alt="https://www.jqwidgets.com/" title="https://www.jqwidgets.com/" src="https://www.jqwidgets.com/wp-content/design/i/logo-jqwidgets.png"/></a> </div> </body> </html>