私はそのようなものに見えるテーブルを持っています
<table id="grid" class="table table-bordered table-hover table-inline">
<thead>
<tr>
<th>Id</th>
<th>Dropdown List</th>
<th><input id="selectAll" type="checkbox" /></th>
</tr>
</thead>
<tbody data-bind="foreach: stuff
<tr>
<td data-bind="text: someId"></td>
<td>
<select class="input-medium" data-bind="options: someStuff, optionsText:'DisplayName', optionsValue:'StandardCode'"></select>
</td>
<td>
<input type="checkbox" data-bind="value: someId"/>
</td>
</tr>
</tbody>
</table>
次に、JavaScriptを使用して、このように選択した行を繰り返し処理します
$('grid input[type="checkbox"]:checked').each(function () {
var someSelectedId= $(this).val();
var dropDownlistValue= ??
});
ノックアウトを使用して、データをテーブルとドロップダウンにバインドしています。
行を反復処理しているときに、各行のドロップダウンリストで選択した値を取得するにはどうすればよいですか?私の人生のために、私はそれを理解できないようです。ありがとう!