Created
January 8, 2015 21:54
-
-
Save dbarrionuevo/e17dbca434e977e0ae52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
YouConnect.Behaviors.AddService = Essential.Behavior.extend({ | |
init: function() { | |
this.category = $('#category_id'); | |
this.addCategoryListener(); | |
}, | |
events: { | |
'submit': 'addFormListener' | |
}, | |
addFormListener: function(e) { | |
e.preventDefault(); | |
$.ajax({ | |
type: 'POST', | |
url: '', | |
data: '', | |
success: function(response) { | |
// Cómo llamo a this.category acá? | |
}, | |
error: function(response) { | |
$.each(response, function(k,v) { | |
// Cómo llamo a this.category acá? | |
}); | |
} | |
}); | |
}, | |
addCategoryListener: function() { | |
this.category.on("change", function(e) { | |
// Cómo llamo a this.category acá? | |
}) | |
}, | |
}); | |
roperzh
commented
Jan 8, 2015
events: {
'submit': 'addFormListener',
'change #category_id': 'doSomething'
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment