こんにちは、knockout.jsのカートエディタの例を使用していますが、データバインドの競合が発生しています。knockout.jsのデータバインドカートエディタの例
<td data-bind='visible:(category().name=="Tops")'>Zipper:<br/>
<select data-bind='options: category() ? category().zipper : null, optionsText: "name", optionsCaption: "Select...", value: zipper'></select></td>
しかし、要素にcategory()。nameをバインドしているため、選択要素が正しく記入されません。もし私が要素上のデータバインドを削除し、以下に示すように要素に配置すると、すべて正常に動作します。
<td>Zipper:<br/>
<select data-bind='visible:(category().name=="Tops"), options: category() ? category().zipper : null, optionsText: "name", optionsCaption: "Select...", value: zipper'></select></td>
私はそれが正しく動作しませんので、何とか要素にデータバインドを入れ、それをロックしていると思いますが、私は、なぜ非常にわかりません。
どのような考えですか?