Please check this fiddle. I am pasting some value in ExtJs 4.1 textareafield but I am not able to the value of the field. Please suggest the ways get the value in the paste event.
Ext.onReady(function () {
Ext.create('Ext.window.Window', {
height: 60,
layout: 'anchor',
minHeight: 60,
width: 200,
items: [{
grow: true,
anchor: '100%',
flex: 1,
enableKeyEvents: true,
xtype: 'textareafield',
id: 'txtFld',
listeners: {
keydown: function (txtArea, e, eOpts) {
//console.log(e.getKey());
if (e.keyCode == 13 && txtArea.value.split("\n").length >= 5) {
console.log('unable to stop :( ');
e.stopEvent();
return false;
}
},
paste: {
element: 'inputEl',
fn: function (event, inputEl) {
if (event.type == "paste") {
console.log('in pasted');
console.log("inputEl.value >> " + inputEl.value);
console.log("inputEl.innerHTML >> " + inputEl.innerHTML);
console.log("inputEl.innerText >> " + inputEl.innerText);
console.log("inputEl.outerText >> " + inputEl.outerText);
console.log("inputEl.outerText >> " + inputEl.outerText);
console.log(' Ext Val >> ' +Ext.getCmp('txtFld').value);
//event.preventDefault();
//return false;
}
}
}
}
}]
}).show();
});