When performing drag reorder of rows in a grid, there's a level of ambiguity in what it means to disallow dropping over some particular record -- should dropping below the record be disallowed, or above the record, or both? What about dropping over the top half of the *next* record, or the bottom half of the *previous* record? In that case the end result would be the same as dropping over the target record itself - you'd still be moving something adjacent to it.
In your particular usage the intent is obvious as long (as the records sit at the top and bottom of the grid), but the default "canAcceptDrop" behavior simply disallows drop before the record. This is documented on the property.
Anyway - the best way to deal with this would be a simple override to 'willAcceptDrop'.
Something like this would work for this case:
Code:
willAcceptDrop:function () { if (!this.Super("willAcceptDrop", arguments)) return false; var dropRecord = this.getRecord(this.getEventRow()); if (dropRecord && dropRecord.canAcceptDrop == false) return false; return true; },
Isomorphic Software
Leave a comment: