使用DOJO从另一个表行单击填充表

使用DOJO从另一个表行单击填充表,dojo,Dojo,我有一个在普通HTML表中的表,而不是在DOJO中。现在我需要一个特性,当我单击一行时,另一个表必须填充与该单击行相关的详细信息。我只需要在DOJO上做。我没有这方面的代码,因为这是一个启动程序。下面是一个如何将onClickEvent连接到TableRow的示例。我正在使用Dojo1.9 HTML表格: <body> <table border="1"> <tr> <th>Berlin</th> <th>Ham

我有一个在普通HTML表中的表,而不是在DOJO中。现在我需要一个特性,当我单击一行时,另一个表必须填充与该单击行相关的详细信息。我只需要在DOJO上做。我没有这方面的代码,因为这是一个启动程序。

下面是一个如何将onClickEvent连接到TableRow的示例。我正在使用Dojo1.9

HTML表格:

<body>
<table border="1">
<tr>
   <th>Berlin</th>
   <th>Hamburg</th>
   <th>M&uuml;nchen</th>
 </tr>
 <tr>
    <td id="m1">Milj&ouml;h</td>
    <td id="m2">Kiez</td>
    <td id="m3">Bierdampf</td>
  </tr>
  <tr>
    <td>Buletten</td>
    <td>Frikadellen</td>
    <td>Fleischpflanzerl</td>
  </tr>
</table>

<div id="InertGridHere"> Here comes the DataGrid</div>
现在,您必须决定传递给构建网格的函数的内容。 下面是上面例子中的提琴:

这是给你的开始: 以及如何使用栅格的教程:


关于,Miriam

您可以这样做:在onClick事件中设置查询并使用过滤器。
require(["dojo/dom","dijit/registry","dojo/on","dojo/json","dojo/domReady!"],function(dom,registry,on,JSON){

on(dom.byId("m1"),"click",function(){
     fillTable('M1');
});
on(dom.byId("m2"),"click",function(){
     fillTable('M2');
});
on(dom.byId("m3"),"click",function(){
     fillTable('M3');
});


function fillTable(Element){

    //programm your query for building the
    //Store for the DGrid
    alert(Element);
 }
});