extjs - 拖放插入 ExtJS 7.3 Classic
问题描述
我正在使用 ExtJS 将拖放功能应用于仪表板中的面板。这些面板内部有小部件,通过拖放用户可以更改这些小部件的位置。
但是当我删除一个小部件时,我正在更改两个小部件的索引,并且目标小部件正在再次加载。
当我删除一个小部件时,我不希望任何小部件再次加载。我该如何解决?
这是我的删除代码:
setDropZone: function (cmp) {
cmp.DropZone = Ext.create("Ext.dd.DropZone", cmp.getEl(), {
getTargetFromEvent: function (event) {
return cmp;
},
onNodeDrop: function (target, dd, e, data) {
debugger;
var component = cmp.up();
var tempWidgetIndex = data.componentClone.widgetIndex;
data.componentClone.widgetIndex = target.widgetIndex;
target.widgetIndex = tempWidgetIndex;
// Insert target to currents place
component.insert(target.widgetIndex, target);
target.saveState();
// Insert current to target
component.insert(
data.componentClone.widgetIndex,
data.componentClone
);
data.componentClone.saveState();
},
ddGroup: "ddgroup"
});
}
如果有人可以提供帮助,那将非常有帮助!非常感谢
解决方案
推荐阅读
- asp.net-mvc - 在用于 WebAPI 和 WebApplication 的通用 c# 类库中获取客户端的 IP 地址
- c - 反向阵列 C
- google-chrome - Google Chrome 声称 TortoiseGit 和 TortoiseSVN 是不兼容的应用程序
- angular - 如何将数据传递到角度材料底页
- xamarin.forms - 构建具有多个列表视图的食谱页面
- ruby-on-rails - 如何访问 json 响应导轨中的值?
- python - 简单的张量流示例:
- pdf - Ghostscript在一页上添加一个,避免处理所有页面(出于速度原因)?
- javascript - 节点“require”语法创建模块的新引用
- javascript - 如何将 setTimeout 操作更改为 requestAnimationFrame?