1 Ext.define('Ext.grid.ViewDropZone', {
2 extend: 'Ext.view.DropZone',
4 indicatorHtml: '<div class="x-grid-drop-indicator-left"></div><div class="x-grid-drop-indicator-right"></div>',
5 indicatorCls: 'x-grid-drop-indicator',
7 handleNodeDrop : function(data, record, position) {
9 store = view.getStore(),
10 index, records, i, len;
12 // If the copy flag is set, create a copy of the Models with the same IDs
14 records = data.records;
16 for (i = 0, len = records.length; i < len; i++) {
17 data.records.push(records[i].copy(records[i].getId()));
21 * Remove from the source store. We do this regardless of whether the store
22 * is the same bacsue the store currently doesn't handle moving records
23 * within the store. In the future it should be possible to do this.
24 * Here was pass the isMove parameter if we're moving to the same view.
26 data.view.store.remove(data.records, data.view === view);
29 index = store.indexOf(record);
30 if (position == 'after') {
33 store.insert(index, data.records);
34 view.getSelectionModel().select(data.records);