How to use the select2/utils.__cache function in select2

To help you get started, we’ve selected a few select2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github select2 / select2 / tests / utils / data-tests.js View on Github external
test('The internal cache for the element is cleared', function (assert) {
    var $element = $('<select data-select2-id="test"></select>');

    Utils.__cache.test = {
        'foo': 'bar'
    };

    Utils.RemoveData($element[0]);

    assert.equal(Utils.__cache.test, null, 'The cache should now be empty');
});
github select2 / select2 / tests / utils / data-tests.js View on Github external
test('The internal cache for the element is cleared', function (assert) {
    var $element = $('<select data-select2-id="test"></select>');

    Utils.__cache.test = {
        'foo': 'bar'
    };

    Utils.RemoveData($element[0]);

    assert.equal(Utils.__cache.test, null, 'The cache should now be empty');
});