JQM + Knockout和一组复选框

时间:2013-10-05 02:30:03

标签: jquery-mobile checkbox knockout.js

我正试图从淘汰赛中绑定到JQM中的列表。数据很好,我能够查看复选框组,问题是复选框被设置为JQM复选框,它们被保留为常规复选框。这是我有的: HTML

        <div data-role="content">       
            <fieldset data-role="controlgroup">
                <legend></legend>
                <!-- ko foreach: orders -->
                    <li class="ui-li ui-li-divider ui-btn ui-bar-b" data-role="list-divider" data-bind="text: CustomerName"></li>
                    <!-- ko foreach: Orders -->
                        <input type="checkbox" data-role="controlgroup" data-bind="attr: { name: 'chk-' + OrderNum + '_' + CustNum, id: 'chk-' + OrderNum + '_' + CustNum }" />
                        <label data-bind="text: 'Order: ' + OrderNum, attr: { for: 'chk-' + OrderNum + '_' + CustNum }"></label>
                    <!-- /ko -->
                <!-- /ko -->
            </fieldset>         

        </div>
    </div>

SCRIPT

$("#orders").on("pageinit", function () {
            console.log("orders.pageinit");
            ko.applyBindings(new OrderVM());

                         console.log("before create");
            $("#orders").trigger("create");
            console.log("after create");
        });

0 个答案:

没有答案