0

I have a table set up like this

<table class="table table-condensed">
        <thead>
            <tr>
                <th>Look</th>
                <th>Lease Company</th>
            </tr>
        </thead>
        <tbody data-bind="foreach: leaseApplicationLooks">
            <tr>
                <td data-bind="text: lookId"></td> 
                <td><select data-bind="options: $parent.leaseCompanies, optionsText: 'name', optionsValue: 'name', value: leaseCompany" /></td>
            </tr>
        </tbody>
    </table>

My view model:

leaseCompanies(datacontext.lookups.applicationCompanies);

This returns an array with a name, type fields

Depending on the row I want to display different options:

For example: Row 1, show all Type = 1, 2 Row 2, show all Type = 2

How would I go about doing this?

4

1 に答える 1

0

必要なタイプごとに異なる配列を設定します。長さが動的である場合は、leaseApplicationLooks の監視可能な子配列を設定し、リース会社のリストを反復処理してそれらを設定します。それは実際には非常に単純です。単純なすべてのJavaScriptループを使用するだけです

于 2013-09-07T14:27:14.410 に答える