PDA

View Full Version : Paste event



tvanzoelen
19 Jan 2012, 4:44 AM
Somebody knows where I can find the paste event for text fields in 4.1?

tvanzoelen
19 Jan 2012, 5:04 AM
Ok delete this thread, found it.



component.getEl().on('paste', function(t, e) {

}, component);

Animal
20 Jan 2012, 9:31 AM
Or as part of the configured listeners:



{
xtype: 'text',
listeners: {
paste: {
element: 'inputEl',
fn: function(event, inputEl) {
}
}
}
}

vikramk
4 Jan 2014, 6:44 AM
I am handling the paste event as below on text field. How can I get the text which is pasted on text box so that I will know whether, user has entered multiline or single line text, please help...

listeners : { paste: {
element: 'inputEl',
fn: function(event, inputEl,obj) {
if(event.type == "paste"){
console.log('vikram paste event is fired:'+ obj.getElement('mytxt1')); }
}
}
},