[英]How to make swapable component in exJs or in javascript
如何在 exJs 或 javascript 中制作可交換組件。
我有兩個組件,兩者都是可拖動的。
xtype : "panel",
title: 'My Apps',
region: 'east',
width: 290,
items:[{
xtype : 'panel',
cls: 'myCLS',
iconCls : 'app-info-appstore',
title: 'Home',
draggable : true,
html : 'Home.',
listeners: {
'render': function(panel) {
panel.body.on('click', function() {
alert('onclick');
});
}
}
},{
xtype : 'panel',
cls: 'myCLS',
title: 'Profile',
iconCls : "app-info-iconToure",
draggable : true,
html : 'Apps',
}
當我將一個拖到另一個時,它是重疊的。 我們如何交換 extJS 中兩個元素的位置。
任何其他圖書館幫助也將起作用。
請注意大衛因為你通常不會回應其他人的帖子,這是我最后一次幫助: 1、2你甚至沒有給我賞金, 3
onDrop 你通過insert將它添加到父容器中。
要獲得正確的 position,您可以根據鼠標 position 或...
onDrop 你得到你當前所在的目標 dom 元素。
const extComponent = Ext.ComponentManager.from(domEl),
currentIndex = ... // search for the position of that item in parent
parent.insert(droppedItem, currentIndex);
進一步的工作
例子
刪除,因為你不回答
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.