0

我们如何在框架中获取选定的单元格值?我通过单击链接调用 iframe。在 Iframe 中,我想获取所选单元格的属性值。

 <script>
        function main(container) {
            if (!mxClient.isBrowserSupported()) {
                mxUtils.error('Browser is not supported!', 200, false);
            }
            else {
                var graph = new mxGraph(container);
                var cell = graph.getSelectionCell();
            }
  </script>

<body onload="main(window.parent.document.getElementById('graphContainer'))">
    <form id="form1" runat="server">

    </form>
</body>
4

1 回答 1

1

如果您使用的是按钮之类的东西

您可以从 evt 获得大部分信息

例如:

    graph.addListener(mxEvent.DOUBLE_CLICK, function(sender, evt)
    {
        var cell = evt.getProperty('cell');
        if (cell != null && cell.parent != main_class) {
                main_class = cell.edges[0].value.slice(14, cell.edges[0].value.indexOf('-') );

ETC....

您显然可以使用 Firefox 中的调试器来确定您要查找的属性在分类中的位置

于 2013-11-01T01:14:49.170 回答