我已经创建了一个图形,并通过拖放将单元格设置到它上面。但是,当发生丢弃或点击时,我无法找到单击的单元格的HTML使用。如何获取maxGraph单元格的内容的ID
例如,我试图获取mxEvent.CLICK
内拖动元素的ID。
graph.addListener(mxEvent.CLICK, function(sender, evt){
var cell = evt.properties.cell;
// cell.id is the cell id, not an id of html that's inside of it.
if(cell) {
var outer = cell.value.outerHTML; // I can see the HTML here encoded
}
})
更新: 所以我的HTML添加到细胞与value.setAttribute('htmlLabel', label);
创建我可拖动的项目时。但htmlLabel似乎并不是evt对象中的任何一个关键字。
感谢您的支持! – BenRacicot
任何时间。如果它帮助某人跳过了我花了很多时间去解决问题,那就值得:-) – shawty