javascript - backbone stickit - reverting model changes -


i'm testing backbone stickit two-way data binding. there way revert changes, example, while editing model data through form, user press cancel button, in pic below

enter image description here

it seems model changed on fly type in form. want when user press cancel button, model revert original value.

i read updatemodel need true value confirm model update. how can edit-view [cancel-event] trigger false value updatemodel function, model not updated textfield value.

do need global variable?

//global variable var updatemodeltitle = true;  //backbone stickit bindings   bindings: {     '#title': {       observe: 'title',       updatemodel: 'confirmupdate'     }   },   confirmupdate: function(val, event, options) {     return updatemodeltitle;   }  //cancel button event click event updatemodeltitle = false; 

thanks in advance help.

try backbone.stickit's sister project: backbone.trackit


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -