コード例 #1
0
 toggleStatus: function () {
     var model = this.get('model'),
         status = !!model.get('discontinued');
     model.set('discontinued', !status);
     
     ProductModel.saveChanges();
 },
コード例 #2
0
            save: function () {
                var that = this;

                // To handle remote call failure,
                // check the uid of model to decide if it should be added again.
                if (this.model.isNew()) {
                    ProductModel.create(this.model);
                }
                ProductModel.saveChanges(function (e) {
                    router.navigate('/product/view/' + that.get('model').productId);
                });

                // Prevent the default button behavior.
                return false;
            },
コード例 #3
0
 destroy: function () {
     ProductModel.destroy(this.get('model'));
     ProductModel.saveChanges(function () {
         router.navigate('/product');
     });
 },