Hmm?, It is indeed built in, with one open issue... What about this ?
Code:
extend : 'Ext.grid.Panel',
alias : 'widget.data_common_data_genericdatagridviewer',
requires : [
'Ext.grid.selection.SpreadsheetModel',
'Ext.grid.plugin.Clipboard',
],
controller : 'data_common_data_genericdatagrid_vc',
viewModel : 'data_common_data_genericdatagrid_vm',
bind : {
selection: '{selectedRow}',
columns : '{columns}',
store : {
// access the data portion from the current record displayed
proxy : {
type : 'memory'
},
data : '{current.data}'
}
},
plugins: [{
ptype: 'cellediting',
clicksToEdit: 1
},{
ptype : 'clipboard',
/**
* TODO : remove this functionality if EXT-16236 is fixed
*/
doPaste: function (format, data) {
this.cmp.fireEvent('onPaste',data)
},
}],
dockedItems : [{
xtype :'toolbar',
dock : 'top',
items : [{
text : /*i18n*/'Add row',
handler : 'onAddRow'
},{
text : /*i18n*/'Remove row',
handler : 'onRemoveRow'
}]
}],
selModel : {
type : 'spreadsheet',
columnSelect : false,
extensible : false, // by default this makes no sense for a viewer
},
emptyText : /*i18n*/'Paste data from the clipboard into the grid',
columnLines : true,
listeners : {
afterrender : 'onAfterRender',
// we take this to capture the paste events by CMD/STRG V
onPaste : 'onPaste'
}
and in the controller's onPaste method :
Code:
onPaste(data){
// do whatever you want with the data
}