Explorar el Código

Merge pull request #745 from shacky/fix_select_load

fix select load
Jiang Qinghua hace 4 años
padre
commit
7b0107c27f

+ 1 - 1
resources/views/form/select-script.blade.php

@@ -61,7 +61,7 @@
                 if (_this.value !== '0' && ! _this.value) {
                     return;
                 }
-                promises.push(refreshOptions(urls[index] + "?q="+ _this.value, target));
+                promises.push(refreshOptions(urls[index] + (urls[index].match(/\?/)?'&':'?') + "q="+ _this.value, target));
             });
 
             $.when(promises).then(function() {});

+ 1 - 1
resources/views/scripts/select.blade.php

@@ -48,7 +48,7 @@
             if (String(this.value) !== '0' && ! this.value) {
                 return;
             }
-            $.ajax("{{ $load['url'] }}?q="+this.value).then(function (data) {
+            $.ajax("{!! $load['url'].(strpos($load['url'],'?')?'&':'?') !!}q="+this.value).then(function (data) {
                 target.find("option").remove();
                 $(target).select2({
                     data: $.map(data, function (d) {