4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js">Ext.define('Ext.grid.ViewDropZone', {
19 extend: 'Ext.view.DropZone',
21 indicatorHtml: '<div class="x-grid-drop-indicator-left"></div><div class="x-grid-drop-indicator-right"></div>',
22 indicatorCls: 'x-grid-drop-indicator',
24 handleNodeDrop : function(data, record, position) {
26 store = view.getStore(),
27 index, records, i, len;
29 // If the copy flag is set, create a copy of the Models with the same IDs
31 records = data.records;
33 for (i = 0, len = records.length; i < len; i++) {
34 data.records.push(records[i].copy(records[i].getId()));
38 * Remove from the source store. We do this regardless of whether the store
39 * is the same bacsue the store currently doesn't handle moving records
40 * within the store. In the future it should be possible to do this.
41 * Here was pass the isMove parameter if we're moving to the same view.
43 data.view.store.remove(data.records, data.view === view);
46 index = store.indexOf(record);
47 if (position == 'after') {
50 store.insert(index, data.records);
51 view.getSelectionModel().select(data.records);