ここでデモを利用しようとしています:
http://knockoutjs.com/examples/cartEditor.html
ただし、使用されるデータセットは次のとおりです: sampleProductCategories - この例では静的です。
jQuery getJson を介して API を呼び出した後、そのデータセットにデータを入力したいと考えています。
したがって、マークアップはページに存在しますが、ビューに入力するデータはまだありません。
sampleProductCategories リストが変更されたときに、マークアップを再トリガーしてそれ自体を再描画するにはどうすればよいですか?
例 - この部分をデータに再描画/再バインドできますか?
<tbody data-bind='foreach: lines'>
<tr>
<td>
<select data-bind='options: sampleProductCategories, optionsText: "TypeName", optionsCaption: "Select...", value: TypeID'></select>
</td>
<td data-bind="with: category">
<select data-bind='options: products, optionsText: "name", optionsCaption: "Select...", value: $parent.product'></select>
</td>
ありがとうございました、
マーク