コードで以下のjQueryを実行すると、次のようになります。
if (data.PCompany.length > 0) {
$.each(data.PCompany, function (i, subEntity) {
html.push('<tr><td id="row"><a style="color:green;text-decoration:underline;cursor:pointer;" id="link">' + subEntity.Name + '</a></td>
<td id="deem">' + subEntity.Deemed + '</td></tr>');
});
}
if (data.CCompany.length > 0) {
$.each(data.CCompany, function (i, subEntity) {
html.push('<tr><td nowrap="nowrap">' + subEntity.Name + '</td><td id="deem1" >'
+ subEntity.Deemed +'</td><td>'+ subEntity.Effect shares+ '</td></tr>');
});
}
これにより、各テーブルに多くの列を持つ2つのテーブルが生成されます。次にsubEntity.Deemed
、テーブルの列の1つをクリックして、両方のテーブルの列の値を取得しpcompany
ます。これは次のような結果になります。
`Pcomapny table`
<td id="deem">1<td> <td id="deem">2<td>
Ccompany
<td id="deem1">3<td> <td id="deem1">4<td> <td id="deem1">5<td> <td id="deem1">6<td>
On first row onclick of Pcompany table i want to get 1 and 3,
1 and 4, 1 and 5, 1 and 6
on second row onclick want to get 2 and 3 , 2 and 4, 2 and 5 etc...