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.18.1 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.18.0 vendor/select2/src/js/select2/data/base.js
radius-rails-3.1.4 app/assets/components/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.17.0 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.16.0 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.6 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.5 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.4 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.3 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.1.2 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.2.pre1 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.1.1 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.1 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.15.0 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.14.2 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.14.1 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.14.0 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.13.4 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.13.3 vendor/select2/src/js/select2/data/base.js
card-mod-bootstrap-0.13.2 vendor/select2/src/js/select2/data/base.js