(function ($, undefined) { var pluginName = 'agDropdownCellEditor', dataKey = 'ag.dropdown.celleditor'; var defaults = { maxHeight: 200 }; // Utility functions var keys = { ESC: 27, TAB: 9, RETURN: 13, LEFT: 37, UP: 38, RIGHT: 39, DOWN: 40, ENTER: 13, SHIFT: 16 } /** * Constructor * @param {[Node]} element [Select element] * @param {[Object]} options [Option object] */ var Plugin = function (input, options) { this.grid = options.grid; this.config = options.config; this.items = options.data.items; this.selected = options.data.selected; this.hook = options.hook; this.arrow = options.arrow || 'icon-search'; this.name = options.name; this.onSelect = options.select || function() {}; this.$input = $(input); // Settings this.settings = $.extend({}, defaults, options); // Initialize this.init(); $.fn[pluginName].instances.push(this); }; $.extend(Plugin.prototype, { init: function () { // Construct the comboselect this._construct(); // Add event bindings this._events(); }, _construct: function () { var me = this; // Wrap the Select this.$container = $('
'); // Append dropdown arrow this.$arrow = $('
'); // Append dropdown this.$dropdown = $('