Explorar o código

Allow to pass a callback as ajax.url

Frédéric Camblor %!s(int64=12) %!d(string=hai) anos
pai
achega
a770ade670
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      select2.js

+ 1 - 1
select2.js

@@ -316,7 +316,7 @@ the specific language governing permissions and limitations under the Apache Lic
                 if( null !== handler) { handler.abort(); }
                 if( null !== handler) { handler.abort(); }
 
 
                 handler = transport.call(null, {
                 handler = transport.call(null, {
-                    url: options.url,
+                    url: ((typeof options.url === 'function')?options.url():options.url),
                     dataType: options.dataType,
                     dataType: options.dataType,
                     data: data,
                     data: data,
                     type: type,
                     type: type,