Showing posts with label onpate event in extjs. Show all posts
Showing posts with label onpate event in extjs. Show all posts

Monday, 22 October 2012

Capture the HTMLEditor's onpaste event


How to capture the HTMLEditor's onpaste event


The key to capturing the onpaste event for the HTMLEditor component is to wait for its initialize event to fire and then add the onpaste handler to its document body:


{
xtype: 'htmleditor',
listeners: {
  initialize: function(cmp) {
    Ext.EventManager.addListener(
      cmp.iframeEl.dom.contentWindow.document.body
      ,'paste'
      ,function(e, el){
         // your action
      });
    }
  }
}