HtmlEditor key 事件

ux.HtmlEditor = Ext.extend(Ext.form.HtmlEditor, {

          frame : true,

          initComponent : function() {

              ux.HtmlEditor.superclass.initComponent.call(this);

              this.addEvents('submit');

          },

          initEditor : function() {

             ux.HtmlEditor.superclass.initEditor.call(this);

              if (Ext.isGecko) {

                  Ext.EventManager.on(this.doc, 'keypress', this.fireSubmit,

                          this);

              }

              if (Ext.isIE || Ext.isWebKit || Ext.isOpera) {

                  Ext.EventManager.on(this.doc, 'keydown', this.fireSubmit,

                          this);

              }

          },

          fireSubmit : function(e) {

              if (e.ctrlKey && Ext.EventObject.ENTER == e.getKey()) {

                  this.fireEvent('submit', this);

              }

          }

      });


Total views.

© 2013 - 2024. All rights reserved.

Powered by Hydejack v6.6.1