I want to drag from an ExtJS grid row into a textarea field at a certain position in the textarea.
HTML5's Drag API supports such drag/drop operations (http://jsfiddle.net/a98bwb07/3/), but I did not find that ExtJS supports this, so I wanted to use the HTML5 Drag API:
document.getElementById('img').addEventListener('dragstart', function (e) {
e.dataTransfer.setData("text", '[img]' + this.id + '[/img]');
e.dataTransfer.setDragImage(this, 0,0);
});
I tried to add a delegated event on the grid:
grid.on({
dragstart: {
fn: function(e) {
console.log(e);
},
delegate: grid.getView().rowSelector
}
})
but it isn't fired. (https://fiddle.sencha.com/#view/editor&fiddle/2dac)
How can I attach the dragstart event to all grid rows in a fashion that survives grid refresh and data changes?