Created
September 29, 2013 16:38
-
-
Save kennethdavidbuck/6754104 to your computer and use it in GitHub Desktop.
Example use of select2 with EmberJS.
This file contains 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
App.Select2View = Em.Select.extend({ | |
_setup:function(){ | |
"use strict"; | |
var placeholder = this.get('prompt'); | |
this.$().select2({ | |
//placeholder:placeholder//, | |
//minimumInputLength:2 | |
}); | |
}.on('didInsertElement'), | |
_tearDown:function(){ | |
"use strict"; | |
this.$().select('destroy'); | |
}.on('willDestroyElement'), | |
change:function(){ | |
"use strict"; | |
this._super(); | |
this.get('controller').send('select',this.get('selection')); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment