jqwidgets-scripts-custom
Version:
jQWidgets is an advanced jQuery, Angular 7, Vue, React, ASP .NET MVC, Custom Elements and HTML5 UI framework.
50 lines (46 loc) • 2.12 kB
JavaScript
import React from 'react';
import ReactDOM from 'react-dom';
import JqxEditor from '../../../jqwidgets-react/react_jqxeditor.js';
class App extends React.Component {
render() {
let tools = 'bold italic underline | format font size | left center right | print';
let createCommand = (name) => {
switch (name) {
case 'print':
return {
type: 'button',
tooltip: 'Print',
init: (widget) => {
widget.jqxButton({ height: 25, width: 40 });
widget.html('<span style="line-height: 23px;">Print</span>');
},
refresh: (widget, style) => {
// do something here when the selection is changed.
},
action: (widget, editor) => {
// return nothing and perform a custom action.
this.refs.myEditor.print();
}
}
}
};
return (
<JqxEditor ref='myEditor' width={800} height={400} tools={tools} createCommand={createCommand}>
<b>jqxEditor</b> 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.
<br />
<br />
Features include:
<br />
<ul>
<li>Text formatting</li>
<li>Text alignment</li>
<li>Hyperlink dialog</li>
<li>Image dialog</li>
<li>Bulleted list</li>
<li>Numbered list</li>
</ul>
</JqxEditor>
)
}
}
ReactDOM.render(<App />, document.getElementById('app'));