Skip to content

Commit

Permalink
Defect 14408: [gridx_Fvt]rowSelection: Row selection works abnormal w…
Browse files Browse the repository at this point in the history
…hen dndRow is enabled in Tree grid.

use "canSwept" flag defined in selector
  • Loading branch information
yfruan committed Apr 22, 2016
1 parent 9676e0c commit 06857d6
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions modules/dnd/_Dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ define([
t._fixFF(t._source, n);
}
t._source.grid = t.grid;
t._saveSelectStatus();
t._disableSelectSwept();
t.loaded.callback();
},

Expand Down Expand Up @@ -139,41 +139,27 @@ define([
}
},

_saveSelectStatus: function(enabled){
_disableSelectSwept(){
var name, selector, selectors = this.grid.select;
if(selectors){
for(name in selectors){
selector = selectors[name];
if(selector && lang.isObject(selector)){
this._selectStatus[name] = selector.arg('enabled');
if(enabled !== undefined){
selector.enabled = enabled;
if(selector.canSwept !== undefined){
selector.canSwept = false;
}
}
}
}
},

_loadSelectStatus: function(){
var name, selector, selectors = this.grid.select;
if(selectors){
for(name in selectors){
selector = selectors[name];
if(selector && lang.isObject(selector)){
selector.enabled = this._selectStatus[name];
}
}
}
},

_checkDndReady: function(evt){
var t = this, name, p;
if(!t._dndReady && !t._dnding && !t._extDnding){
for(name in t._profiles){
p = t._profiles[name];
if(p.arg('enabled') && p._checkDndReady(evt)){
t.profile = p;
// t._saveSelectStatus(false);
domClass.add(win.body(), 'gridxDnDReadyCursor');
t._source.notSelectText = 1;
t._dndReady = 1;
Expand All @@ -185,7 +171,6 @@ define([

_dismissDndReady: function(){
if(this._dndReady && !this._dndBegun){
this._loadSelectStatus();
this._dndReady = 0; //0 as false
domClass.remove(win.body(), 'gridxDnDReadyCursor');
}
Expand Down Expand Up @@ -218,8 +203,6 @@ define([
t.grid.vScrollerNode.focus();
p._onBeginDnd(t._source);
dom.setSelectable(t.grid.domNode, false);
t._saveSelectStatus(evt.shiftKey||evt.ctrlKey);

}
},

Expand All @@ -245,7 +228,6 @@ define([
domClass.remove(win.body(), 'gridxDnDReadyCursor');
t.profile._onEndDnd();
t._source.notSelectText = 0;
t._loadSelectStatus();
}
},

Expand Down

0 comments on commit 06857d6

Please sign in to comment.