1

我在 KO 中的每个循环都有下拉列表,当我更改任何一个下拉列表中的值时,其他下拉列表不应该具有选定的值。我曾经$data获取值,如何使用订阅

<div  class="row" data-bind = "foreach: { data: $data, as: 'columnValues' }">
    <div class="col" >  
       <select id ="SELECT" data-bind="options: getColumnValues($root.AttributeSpecifications,columnValues), optionsText: 'AttributeName', optionsCaption: 'Select Attribute...', optionsValue: columnValues, value: Attribute"></select>
       <div data-bind="visible: Attribute() != null" class="option">
           <div>
               <span>with any of the following values:</span>
           </div>
           <div class="option">
               <a class="queryType link" href="#" data-bind="click: function (data, event) { columnValues.QueryType(0) }">List</a> | <a  class="queryType link" href="#" data-bind="    click: function (data, event) { $data.QueryType(1) }">Range</a>
           </div>
               <div data-bind="template: { name: function () { return templateName(Attribute, QueryType) } }"></div>  
           </div>
       </div> 
    </div>
4

0 回答 0