Sha256: b5254644faa727706e158472ab738711bf250790bdab100a3652194a437df33a

Contents?: true

Size: 1005 Bytes

Versions: 86

Compression:

Stored size: 1005 Bytes

Contents

define([
  '../utils'
], function (Utils) {
  function BaseAdapter ($element, options) {
    BaseAdapter.__super__.constructor.call(this);
  }

  Utils.Extend(BaseAdapter, Utils.Observable);

  BaseAdapter.prototype.current = function (callback) {
    throw new Error('The `current` method must be defined in child classes.');
  };

  BaseAdapter.prototype.query = function (params, callback) {
    throw new Error('The `query` method must be defined in child classes.');
  };

  BaseAdapter.prototype.bind = function (container, $container) {
    // Can be implemented in subclasses
  };

  BaseAdapter.prototype.destroy = function () {
    // Can be implemented in subclasses
  };

  BaseAdapter.prototype.generateResultId = function (container, data) {
    var id = container.id + '-result-';

    id += Utils.generateChars(4);

    if (data.id != null) {
      id += '-' + data.id.toString();
    } else {
      id += '-' + Utils.generateChars(4);
    }
    return id;
  };

  return BaseAdapter;
});

Version data entries

86 entries across 86 versions & 7 rubygems

Version Path
card-mod-bootstrap-0.13.1 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.13.0 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.7 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.12.0 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.6 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.5 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.4 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.3 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.2 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.1 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.11.0 vendor/select2/src/js/select2/data/base.js
card-1.100.0 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.99.6 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.99.5 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.99.4 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.99.3 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.99.2 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.99.1 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.99.0 mod/bootstrap/vendor/select2/src/js/select2/data/base.js
card-1.98.3 mod/bootstrap/vendor/select2/src/js/select2/data/base.js