delagoutte Posted April 29, 2016 Posted April 29, 2016 Hello, I have a drag and drop functionality between a unidbgrid and a unitreeview. For do that i,'m using this code : on unidbgrid function beforeInit(sender, config) { config.enableColumnMove = true; config.viewConfig = { plugins: { ptype: 'gridviewdragdrop', dragGroup: 'MainGridDrag', dropGroup: 'UserTreeDrop' } } } on treeview : function beforeInit(sender, config) { config.viewConfig= { plugins: { ptype: 'gridviewdragdrop', dragGroup: 'UserTreeDrop', dropGroup: 'MainGridDrag', enableDrag: false }, listeners: { beforedrop: function(node, data, overModel, dropPos, opts) { this.droppedRecords = data.records; data.records = []; }, drop: function(node, data, overModel, dropPos, opts) { var SelectRec = ''; Ext.iterate(this.droppedRecords, function(record) { if (SelectRec == '') {SelectRec += record.get('id')} else {SelectRec += '-'+record.get('id')}; }); ajaxRequest(sender, "_ddrop", ["GridSel=" + SelectRec , "TreeSel=" + overModel.get('id')]); this.droppedRecords = undefined; } } } } the functionality must working like outlook, i have records on unidbgrid that i affect on directory(treeview node) with drag and drop functionality. After when i click on node that is doing a filter on grid for having the record affected to this directory My problem is when i drop record on treeview the onchange event is fired before drop event. How to suspend event onchange when i'm using drag and drop ? i'm trying sender.getSelectionModel().suspendEvents(true); on beforedrop and ajaxRequest(sender, "_ddrop", ["GridSel=" + SelectRec , "TreeSel=" + overModel.get('id')]); sender.getSelectionModel().resumeEvents(); on drop but it don't work. Any Idea ? Quote
delagoutte Posted May 3, 2016 Author Posted May 3, 2016 fixes : i'm using onclick event and not onchange event. with this method i don't have problem Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.