EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: proceno72 on May 13, 2019, 08:36:18 AM



Title: Undo function on texteditor
Post by: proceno72 on May 13, 2019, 08:36:18 AM
I'm trying to extend texteditor with undo function with this code:
Code:
$.extend($.fn.texteditor.defaults.commands, {
        'undo': {
            type: 'linkbutton',
            iconCls: 'icon-undo-bn',
            onClick: function(){
                var disabled = $(this).texteditor('getEditor').dialog('dialog').hasClass('texteditor-disabled');
                var readonly = $(this).texteditor('getEditor').dialog('dialog').hasClass('texteditor-readonly');
                if ((disabled === false) && (readonly === false))  {
                    var t = $(this).texteditor('getEditor');
                    t.focus();
                    t.trigger('mouseup');
                    t.texteditor('execCommand','undo');
                }
            }           
        } 
});
I noticed a strange issue when I use it on a page where there is also a datagrid with "editable datagrid" and/or "datagrid filter row" extensions enabled
In this case I've an undo effect on datagrid textbox fields generated by these extensions