Last active
April 4, 2016 13:33
-
-
Save felipebastosweb/dc2e19528b0c92f222e2a9a7c1f6689e to your computer and use it in GitHub Desktop.
ModelView em Javascript + jQuery para preencher comboBox gerado pelo Grails
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
| var Escola = function(){ | |
| this.fillSelect = function(){ | |
| $.get('/escola/index.json', {}, function(data){ | |
| $.each(data, function(index, escola){ | |
| $("#escola-id").append('<option value="'+escola.id+'">'+escola.nome+'</option>'); | |
| }); | |
| }, "json"); | |
| }; | |
| }; | |
| $(document).ready(function(){ | |
| var escola = new Escola; | |
| escola.fillSelect(); | |
| var curso = new Curso; | |
| curso.fillSelect(); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment