PDA

View Full Version : [INFOREQ] Ext.grid.plugin.Clipboard "cut" validateAction



Johnny Major
26 Apr 2017, 4:50 PM
The clipboard plugin has "validateAction" that is called and if it returns false it shouldn't process the cut/paste/copy. However, when a cut is requested the method "doCutCopy" actually clears the data "me.getData(erase, formats)" before it checks the validateAction. I would think the clear of the data should only happen if after it checks validateAction.



doCutCopy: function (event, erase) {
var me = this,
formats = me.allFormats || me.syncFormats(),
data = me.getData(erase, formats),
memory = me.getMemory(),
system = me.getSystem(),
sys;

if (me.validateAction(event) === false) {
return;
}

me.shared.data = memory && data;

if (system) {
sys = data[system];
if (formats[system] < 3) {
delete data[system];
}
me.setClipboardData(sys);
}
}

Gary Schlosberg
27 Apr 2017, 2:54 PM
Thanks for the report. Can you please post a test case which demonstrates the issue you are having with the plugin?
https://fiddle.sencha.com/#view/editor

Johnny Major
28 Apr 2017, 6:27 PM
Here you go.... https://fiddle.sencha.com/#view/editor&fiddle/1urm