我有一个foreach
使用 observablearray,名为CertificateDetailsToShow
. CertificateDetailsToShow
有一个名为 的列LoanNum
。嵌套在 foreach 中,我有一个选择列表,它使用一个名为DDABankNum
s 的 observablearray(填充选择列表选项)。它有一个属性叫做mLoanNum
。我想根据LoanNum
两个 observablearrays ( DDABankNums.mLoanNum = CertificateDetailsToShow.LoanNum
) 过滤选择列表中显示的内容。我怎样才能做到这一点?
我的视图代码-
<tbody data-bind="foreach: CertificateDetailsToShow">
<tr id="Tr1" style="cursor: pointer">
<td>
<ul style="width: 100%">
<h5 class="muted"><b>Loan: <span class="muted" data-bind="text: LoanNum"></span> (<span data-bind=" text: CurrType"></span>)</b>
<select id="Select1" style="margin-top: 0px; height: 24px; width: 160px !important"
data-bind="options: $parent.DDABankNums, optionsText: 'AccountName', value: $parent.mLoanNum, optionsCaption: $data.LoanNum">
</select>
</h5>
</ul>
</td>
</tr>
</tbody>