EasyUI Forum
May 03, 2024, 10:29:14 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Undo function on texteditor  (Read 2274 times)
proceno72
Newbie
*
Posts: 39



View Profile
« 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!