Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head><title>Select2</title></head>
- <body>
- <div>
- <label class="col-sm-12 text-white" style="text-align: left;" data-i18n="store.tipo"> </label>
- <div class="col-sm-12">
- <select id="selectTipo" class="form-control"></select>
- <br/>
- <br/>
- </div>
- </div>
- <script src="~/lib/jquery.js" type="text/javascript"></script>
- <script src="~/lib/select2.js" type="text/javascript"></script>
- <script src="~/js/arquivo.js" type="text/javascript"></script>
- <script type="text/javascript">
- $(document).ready(function(){
- GetTipo();
- })
- </script>
- </body>
- </html>
- function GetTipo(){
- var $selectTipo = $('#selectTipo');
- $selectTipo.append($('<option data-i18n="store.comboTipos.todos">', { value: "0", text: $(this).data('data-i18n')}));
- $selectTipo.append($('<option data-i18n="store.comboTipos.painel">', { value: "1", text: $(this).data('data-i18n') }));
- $selectTipo.append($('<option data-i18n="store.comboTipos.report">', { value: "2", text: $(this).data('data-i18n') }));
- $selectTipo.append($('<option data-i18n="store.comboTipos.notificacao">', { value: "3", text: $(this).data('data-i18n') }));
- $selectTipo.append($('<option data-i18n="store.comboTipos.auditoria">', { value: "4", text: $(this).data('data-i18n') }));
- $selectTipo.append($('<option data-i18n="store.comboTipos.apresentacao">', { value: "5", text: $(this).data('data-i18n') }));
- $selectTipo.val("0").trigger("change");
- $selectTipo.select2();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement