backbone.js - Backbone collection export issues -


i have collection of users (model user) model has boolean value: isexport have button on click supposed post server users isexport=true can suggest suitable solution problem?

i know it's possible wrap collection model , overwrite tojson function couldn't manage far (can please give code example?)

app.user = backbone.model.extend({ defaults: {isexport: false}...}); app.users = backbone.collections.extend({model: app.user...});  

thanks! roy

backbone collections default don't have write operations server, you'll need add new method collection subclass such doexport, use .where models isexport=true , tojson() array of objects can send server backbone.sync or $.post.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -