<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
- <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
- <script type="text/javascript" src="../prettify/prettify.js"></script>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
// So a View's DragZone cannot use the View's main element because the DropZone must use that
// because the DropZone may need to scroll on hover at a scrolling boundary, and it is the View's
// main element which handles scrolling.
- // We use the View's parent element to drag from. Ideally, we would use the internal structure, but that
+ // We use the View's parent element to drag from. Ideally, we would use the internal structure, but that
// is transient; DataView's recreate the internal structure dynamically as data changes.
// TODO: Ext 5.0 DragDrop must allow multiple DD objects to share the same element.
me.callParent([me.view.el.dom.parentNode]);
onItemMouseDown: function(view, record, item, index, e) {
if (!this.isPreventDrag(e, record, item, index)) {
this.handleMouseDown(e);
+
+ // If we want to allow dragging of multi-selections, then veto the following handlers (which, in the absence of ctrlKey, would deselect)
+ // if the mousedowned record is selected
+ if (view.getSelectionModel().selectionMode == 'MULTI' && !e.ctrlKey && view.getSelectionModel().isSelected(record)) {
+ return false;
+ }
}
},
// Update the selection to match what would have been selected if the user had
// done a full click on the target node rather than starting a drag from it
if (!selectionModel.isSelected(record) || e.hasModifier()) {
- selectionModel.selectWithEvent(record, e);
+ selectionModel.selectWithEvent(record, e, true);
}
data.records = selectionModel.getSelection();