ページに「すべて選択」チェックボックスがあり、以下のチェックボックスの選択を解除して選択します。
<div class="field">
<div class="SelectAllCheckBox">
<input type="checkbox" id="SelectAllCheckBox" />
<label for="SelectAllCheckBox">Select All</label>
</div>
</div>
<div id="TargetsPanel" class="panel" style="display: block;">
<div class="body stack-calc">
<table id="TargetsTable" class="tm-list" cellspacing="0">
<colgroup>
<col width="20px">
<col width="20%">
<col>
</colgroup>
<thead>
<tr>
<th></th>
<th> Language </th>
<th> Workflow </th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td>
<span class="LanguageName">Arabic</span>
<ul class="Publications">
<li>
<img alt="" src="/test/tt.png">
<input type="checkbox" id="tcm:0-235-1" name="tcm:0-235-1" checked="checked">
<label for="tcm:0-235-1">Test Arabic</label>
</li>
</ul>
</td>
<td><select name="_1041" disabled=""><option value="1650">Test</option></select></td>
</tr>
<tr>
<td></td>
<td>
<span class="LanguageName">Test Chinese (HongKong)</span>
<ul class="Publications">
<li>
<img alt="" src="/test/mm.png">
<input type="checkbox" id="tcm:0-368-1" name="tcm:0-368-1" checked="checked">
<label for="tcm:0-368-1">Test (Traditional Chinese)</label>
</li>
</ul>
</td>
<td><select name="_1116" disabled=""><option value="1650">Test2</option></select></td>
</tr>
...
...
...//It goes on for other checkboxes.
...
...
</tbody>
</table>
</div>
</div>
ここで、すべてのチェックボックスの下にある「SelectAllCheckBox」チェックボックスで選択および選択解除機能を使用したいと考えています。チェックボックスがチェックボックスであることを除いて、マッピングを行うためのチェックボックスに共通するものは何もありません。
<input type="checkbox" id="tcm:0-235-1" name="tcm:0-235-1" checked="checked">
<input type="checkbox" id="tcm:0-368-1" name="tcm:0-368-1" checked="checked">
....
....
....
ありがとう
編集:
c.SelectAllCheckBox = $("#SelectAllCheckBox"); //I am initializing the existing checkbox id
$evt.addEventHandler(c.SelectAllCheckBox, "click", this.getDelegate(this._onSelectAllCheckBoxClick)); //Here I am adding the event listner
TranslationJob.prototype._onSelectAllCheckBoxClick = function TranslationJob$_onSelectAllCheckBoxClick(headDoc, items)
{
var p = this.properties;
var c = p.controls;
//Here I want code which will deselect and select the checkboxes
};
必須:
マスターが選択されている場合はすべての子が選択され、マスターが選択解除されたらすべての子が選択解除され、子チェックボックスのいずれかが選択解除された場合はマスターが選択解除され、すべての子が選択された場合も同様に機能する必要があります。自動的に選択されます