Ext.Containerがあり、ユーザーが移動可能なオブジェクトを追加する必要があります。
Ext.Windowがオブジェクトにネストされていないことが他の場所でわかります。したがって、他の移動可能なExtオブジェクトに関する私のオプションは何ですか?
よろしく、キャスパー
Ext.Containerがあり、ユーザーが移動可能なオブジェクトを追加する必要があります。
Ext.Windowがオブジェクトにネストされていないことが他の場所でわかります。したがって、他の移動可能なExtオブジェクトに関する私のオプションは何ですか?
よろしく、キャスパー
この問題に戻ると、あなたの提案は途中で私を助けてくれました。パネルのExtJSドキュメントでは、 draggableのカスタム実装を行う方法が提案されています。
draggable: {
// Config option of Ext.Panel.DD class.
// It's a floating Panel, so do not show a placeholder proxy in the original position.
insertProxy: false,
// Called for each mousemove event while dragging the DD object.
onDrag : function(e){
// Record the x,y position of the drag proxy so that we can
// position the Panel at end of drag.
var pel = this.proxy.getEl();
this.x = pel.getLeft(true);
this.y = pel.getTop(true);
// Keep the Shadow aligned if there is one.
var s = this.panel.getEl().shadow;
if (s) {
s.realign(this.x, this.y, pel.getWidth(), pel.getHeight());
}
},
// Called on the mouseup event.
endDrag : function(e){
this.panel.setPosition(this.x, this.y);
}
}
私のプロジェクトでは、コンテナー要素内にドラッグ可能な要素が必要だったので、何か特別なことをする必要がありました。
なんで?
位置情報の取得はbrowser-window-spaceで行われ、位置の設定はparent-spaceにあるように見えるためです。したがって、最終的なパネル位置を設定する前に位置を変換する必要がありました。
// Called on the mouseup event.
endDrag: function (e) {
if (this.panel.ownerCt) {
var parentPosition = this.panel.ownerCt.getPosition();
this.panel.setPosition(this.x - parentPosition[0], this.y - parentPosition[1]);
} else {
this.panel.setPosition(this.x, this.y);
}
}
これが他の人に役立つことを願っています。また、ご意見をお寄せいただきありがとうございます:)
でパネルを作成するdraggable:true
よくわかりませんがfloating
、パネルの属性を試すことができるかもしれません。