2012-12-24 64 views
0

我们如何在框架中获得选定的单元格值?我通过点击链接来调用iframe。并在iframe中我想获得选定单元格的属性值。如何在mxGraph的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> 
+0

iFrame是否在同一个域上?你可以告诉我们你的HTML设置..也许是一个http://jsfiddle.net的例子吗? – ManseUK

+0

是的,Iframe在同一个域中。 –

回答

0

如果你正在使用类似的按钮

你可以得到最要从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('-')); 

等..

你明明可以在firefox中使用调试器来确定你所在属性的位置在生物分类系统中居住

相关问题