How to fix issue in Extjs when my app is RTL?

Viewed 63

When I drop my panel in non drop zone the Extjs animate the drag element back to the source element in wrong directions, how to fix this behavior? enter image description here

Here is my code for Dragzone and DropZone, when I change my app to LTR it just fine, and when I switch it back to RTL then the issue appears again.

function calEventPnlSourceDD(sender){
  sender.mX=sender.getX();
  sender.dragZone = new Ext.dd.DragZone(sender.getEl(), {
        ddGroup: 'dgCal',
        getDragData: function(e) {
            var sourceEl = e.getTarget(sender.itemSelector, 10);
            if (sourceEl) {
                /*sourceEl=sourceEl.parentElement;*/                             
                d = sourceEl.cloneNode(true);
                d.id = Ext.id();
                return {
                    ddel: d,
                    sourceEl: sourceEl,
                    repairXY: Ext.fly(sourceEl).getXY()
                }
            }
        },
        getRepairXY: function() {
                return this.dragData.repairXY;
          },
        onDrag: function(e) {
        
        }
  });
}
function calEventPnlTargetDD(sender){
 sender.dropZone = new Ext.dd.DropZone(sender.el, {
        ddGroup: 'dgCal',
        isDropAllowed: false,
        getTargetFromEvent: function(e) {
            return e.getTarget(sender.rowSelector);
        },              
        getAllowed: function(e) {
            var proto = Ext.dd.DropZone.prototype;
            var tg=e.target;           
            this.isDropAllowed=true;  
            return proto.dropAllowed;
        },
        notifyOver: function(source,e,data) {           
            return this.getAllowed(e);
        },
        onNodeDrop: function(target, dd, e, data) {            
         return this.isDropAllowed;
        }
  });

1 Answers

After 9 days I found the cause of the problem, in my local file local-he.js I removed this line:

Ext.define('Ext.locale.container.Viewport',{override:'Ext.container.Viewport',requires:['Ext.rtl.*'],rtl:!0});

Because I already defined my app as RTL in UniMainModule.

I use Unigui framework with Delphi :-)

Related