Advertisement
DevGiu

test backbone

Aug 7th, 2016
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var AlmacenesView = Backbone.View.extend({
  2.   events: {
  3.     "submit form": "formHandler",
  4.     "click #ref":   "aclick"
  5.   },
  6.   formHandler: function(evt) {
  7.     evt.preventDefault();
  8.     var nombreAlm = $j('#ref').val();
  9.     this.$el.append('<p>hello: ' + nombreAlm + '</p>');
  10.     $j('#ref').val('<p>hello: ' + nombreAlm + '</p>')
  11.   },
  12.   aclick: function(evt){
  13.       console.log(evt);
  14.   }
  15. });
  16.  
  17. $j().ready(function(){
  18.     //{el: $j('.container')}
  19.   var myForm = new AlmacenesView({el: $j('.container')});
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement