我有一个Draw2d(js)自定义图形(表),其中包含嵌套的自定义图形(列)。我想将列从一个表拖放到另一个表。我只想从你们那里获得一些有关如何启用grag&drop的准则,我将处理其他逻辑。我看过new draw2d.layout.locator.DraggableLocator()
的东西,但这对我不起作用。
const Table = draw2d.shape.layout.VerticalLayout.extend({
NAME: "Table",
init: function(attr, setter, getter) {
this._super(attr
setter,
getter
);
this.header = new draw2d.shape.layout.HorizontalLayout();
this.tableNameLabel = new draw2d.shape.basic.Label({ text: attr.name || "Table" });
this.header.add(this.tableNameLabel);
this.add(this.header, { row: 0, col: 0 });
this.columns = attr.columns;
(attr.columns || []).map((obj, j) => {
this.add(
new Column({
name: obj.name,
dataType: obj.dataType
}),
new draw2d.layout.locator.DraggableLocator() // <---------------------------- Adding locator here
);
});
},
setName: function(name) {
this.tableNameLabel.setText(name);
return this;
}
});
预先感谢:)