Last change
on this file since a436340 was a436340, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 17 months ago |
Adding customer registration
|
-
Property mode
set to
100644
|
File size:
788 bytes
|
Rev | Line | |
---|
[a436340] | 1 | $(document).ready(function() {
|
---|
| 2 | var enumerations = {};
|
---|
| 3 | $.ajax({
|
---|
| 4 | url: "http://localhost:8080/api/nomenclatures/businessTypes"
|
---|
| 5 | }).then(function(data) {
|
---|
| 6 | enumerations = data;
|
---|
| 7 | var $el = $("#companyType");
|
---|
| 8 | //$el.empty(); // remove old options
|
---|
| 9 |
|
---|
| 10 | $.each(data, function(index, obj) {
|
---|
| 11 | $el.append($("<option></option>")
|
---|
| 12 | .attr("value", obj.value).text(obj.text));
|
---|
| 13 | });
|
---|
| 14 | });
|
---|
| 15 |
|
---|
| 16 | $("#companyType").change(function() {
|
---|
| 17 | var selectedVal = $(this).find(':selected').val();
|
---|
| 18 | var selectedText = $(this).find(':selected').text();
|
---|
| 19 | alert(JSON.stringify(enumerations[selectedVal-1]));
|
---|
| 20 | })
|
---|
| 21 | });
|
---|
| 22 |
|
---|
| 23 | document.addEventListener('DOMContentLoaded', e => {
|
---|
| 24 | $('#input-prefetch').autocomplete()
|
---|
| 25 | }, false); |
---|
Note:
See
TracBrowser
for help on using the repository browser.