diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 8fcf299915..ac9b2f1402 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -102,7 +102,8 @@ selectObserver, menuObserver, classObserver, - module + module, + tempDisableApiCache = false ; module = { @@ -869,11 +870,12 @@ if (!$module.api('get request')) { module.setup.api(); } - apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks); + apiSettings = $.extend(true, {}, apiSettings, settings.apiSettings, apiCallbacks, tempDisableApiCache ? { cache: false } : {}); $module .api('setting', apiSettings) .api('query') ; + tempDisableApiCache = false; }, filterItems: function (query) { @@ -2399,6 +2401,11 @@ module.set.value('', null, null, preventChangeTrigger); }, + clearCache: function () { + module.debug('Clearing API cache once'); + tempDisableApiCache = true; + }, + scrollPage: function (direction, $selectedItem) { var $currentItem = $selectedItem || module.get.selectedItem(), @@ -3449,7 +3456,7 @@ return settings.apiSettings && module.can.useAPI(); }, noApiCache: function () { - return settings.apiSettings && !settings.apiSettings.cache; + return tempDisableApiCache || (settings.apiSettings && !settings.apiSettings.cache); }, single: function () { return !module.is.multiple();