From: Alan Knowles Date: Fri, 14 Jan 2011 08:55:46 +0000 (+0800) Subject: Pman.Tab.AdminContactsGroup.js X-Git-Url: http://git.roojs.org/?p=Pman.Admin;a=commitdiff_plain;h=077fb41a8342ebae05c10dc2a73718b360ea633e Pman.Tab.AdminContactsGroup.js --- diff --git a/Pman.Tab.AdminContactsGroup.js b/Pman.Tab.AdminContactsGroup.js index 4c5ac23..79ac74a 100644 --- a/Pman.Tab.AdminContactsGroup.js +++ b/Pman.Tab.AdminContactsGroup.js @@ -97,66 +97,7 @@ Pman.Tab.AdminContactsGroup = new Roo.util.Observable({ }, dragdrop : function (_self, dd, targetId, e) { - Roo.log("DROP"); - var t = Roo.lib.Event.getTarget(e); - var ri = _this.grid.view.findRowIndex(t); - var rid = false; - if (ri !== false) { - rid = _this.grid.getDataSource().getAt(ri).data; - } - var s = _this.grid.getSelectionModel().getSelections(); - - //console.log(data); - var isFromGroup = s.length ? s[0].data.id > 0 : false; - - var isToGroup = rid && rid.id > 0; - - if (isFromGroup && isToGroup) { - return false; - } - if (!isFromGroup && !isToGroup) { - return false; - } - var action = 'add'; - if (isFromGroup && !isToGroup) { - action = 'sub'; - //return 'x-dd-drop-ok-sub'; - } - // build a list of selections. - var sels = []; - for (var i=0; i < data.selections.length; i++) { - sels.push(data.selections[i].data.id); - } - - Pman.request({ - url: baseURL + '/Core/GroupMembers.php', - params: { - action : action, - group_id: action =='add' ? rid.id : s[0].data.id, - type: _this.type, - user_ids : sels.join(',') - - }, - method: 'POST', - success : function(data) { - refreshPager(); - }, - - failure: function() { - //Ext.get(document.body).unmask(); - //if (cb) { - // cb.call(false); - //} - - } - }); - - - - //if (!isFromGroup && isToGroup) { - //return 'x-dd-drop-ok-add'; - return true; - //} + }, enddrag : function (_self, dd, e)