JavaScript Editor

Set the createCommand property of the jqxEditor. Author: http://jqwidgets.com

by mark edwards

HTML

<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<textarea id="editor"></textarea>

JavaScript

$('#editor').jqxEditor({
    height: 400,
    width: 500,
    theme: 'energyblue',
    tools: 'datetime | print | clear',
    createCommand: function (name) {
        switch (name) {
            case "datetime":
                return {
                  
                    tooltip: "SHIT",
                    init: function (widget) {
                        widget.jqxDropDownList({
                            placeHolder: "SHIT",
                            width: 170,
                            source: ['AAAA', 'VVVV'],
                            autoDropDownHeight: true
                        });
                    },
                    refresh: function (widget, style) {
                        // do something here when the selection is changed.
                        widget.jqxDropDownList('clearSelection');
                    },
                    action: function (widget, editor) {
                        
                        // return object with command and value members.
                        return {
                            command: "inserthtml",
                            value:   widget.val()
                        };
                    }
                }
                
                
        }
    }
});