0

ここでコードを見つけましたが、データベースへの挿入を提供していません
http://www.spicevanjava.nl/tech-talk/shopping-cart-ui-demo-mobile-version/

ここに例
index.html

<script type="text/template" id="submit-btn-tmpl">
    <button data-icon="arrow-d" data-theme="b" id="submit-btn">Submit</button>
</script>

shopping-cart.js

// Submit Button
var SubmitButton = Backbone.View.extend({
    el: '.basket-footer',

    //get template
    template:  $('#submit-btn-tmpl').template(),

    appRouter: null,

    initialize: function() {
        // set appRouter
        this.appRouter = this.options.appRouter;
    },

    render : function () {

        var totalPrice = 0

        // get total price
        if (this.appRouter.basketItems.length > 0)
            totalPrice = this.appRouter.basketItems.totalPrice();

        // clean up
        $('#submit-btn').remove();

        // and finally render this view with total price
        $(this.el).append($.tmpl(this.template, {price:totalPrice}));
    }
});
4

0 に答える 0