Lines Matching defs:id

416      *      Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true}
474 * If the array form is used it is assumed that it contains objects with 'id' and 'text' keys.
477 * an array of objects that will be used as choices. These objects must contain at least an 'id' key. The 'text'
549 filtered.results.push(isObject ? this : {id: this, text: this});
628 if (token !== undefined && token !== null && opts.id(token) !== undefined && opts.id(token) !== null) {
631 if (equal(opts.id(token), opts.id(selection[i]))) {
676 this.id=opts.id;
693 this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid()).replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g, '\\$1');
695 this.container.attr("id", this.containerId);
845 id:element.prop("value"),
874 $.each(["id", "multiple", "ajax", "query", "createSearchChoice", "initSelection", "data", "tags"], function () {
883 var populate, id=this.opts.id, liveRegion=this.liveRegion;
896 selectable = (!disabled) && (id(result) !== undefined);
911 label.attr("id", "select2-result-label-" + nextUid());
940 if (typeof(opts.id) !== "function") {
941 idKey = opts.id;
942 opts.id = function (e) { return e[idKey]; };
947 throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
987 // this is needed because inside val() we construct choices from options and there id is hardcoded
988 opts.id=function(e) { return e.id; };
1003 opts.createSearchChoice = function (term) { return {id: $.trim(term), text: $.trim(term)}; };
1009 var obj = { id: this, text: this },
1012 $(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } });
1023 throw "query function not defined for Select2 " + opts.element.attr("id");
1092 var evt = $.Event("select2-selecting", { val: this.id(data), object: data });
1334 mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");
1359 // move the global id to the correct dropdown
1360 $("#select2-drop").removeAttr("id");
1361 this.dropdown.attr("id", "select2-drop");
1399 this.dropdown.removeAttr("id"); // only the active dropdown has the select2-drop id
1513 this.search.attr("aria-activedescendant", choice.find(".select2-result-label").attr("id"));
1521 this.opts.element.trigger({ type: "select2-highlight", val: this.id(data), choice: data });
1718 if (def !== undefined && def !== null && self.id(def) !== undefined && self.id(def) !== null) {
1721 return equal(self.id(this), self.id(def));
1986 $("label[for='" + this.focusser.attr('id') + "']")
1987 .attr('for', this.opts.element.attr("id"));
2011 selection.find(".select2-chosen").attr("id", "select2-chosen-"+idSuffix);
2013 this.results.attr("id", "select2-results-"+idSuffix);
2017 this.focusser.attr("id", "s2id_autogen"+idSuffix);
2019 elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
2023 .attr('for', this.focusser.attr('id'));
2032 this.search.attr("id", this.focusser.attr('id') + '_search');
2035 .text($("label[for='" + this.focusser.attr('id') + "']").text())
2036 .attr('for', this.search.attr('id'));
2191 this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
2244 var id = element.val();
2245 //search in data by id, storing the actual matching item
2249 var is_match = equal(id, opts.id(el));
2301 if (equal(self.id(elm.data("select2-data")), self.opts.element.val())) {
2346 this.opts.element.val(this.id(data));
2349 this.opts.element.trigger({ type: "select2-selected", val: this.id(data), choice: data });
2358 if (!equal(old, this.id(data))) {
2420 // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
2430 self.opts.element.val(!data ? "" : self.id(data));
2463 this.opts.element.val(!value ? "" : this.id(value));
2519 var is_match = $.grep(ids, function(id) {
2520 return equal(id, opts.id(el));
2532 var id = ids[i];
2535 if (equal(id, opts.id(match))) {
2572 $("label[for='" + this.search.attr('id') + "']")
2573 .attr('for', this.opts.element.attr("id"));
2593 this.search.attr("id", "s2id_autogen"+nextUid());
2596 .text($("label[for='" + this.opts.element.attr("id") + "']").text())
2597 .attr('for', this.search.attr('id'));
2851 if (indexOf(self.id(this), ids) < 0) {
2852 ids.push(self.id(this));
2885 this.opts.element.trigger({ type: "selected", val: this.id(data), choice: data });
2948 id = this.id(data),
2983 val.push(id);
3007 evt.val = this.id(data);
3015 while((index = indexOf(this.id(data), val)) >= 0) {
3023 this.opts.element.trigger({ type: "select2-removed", val: this.id(data), choice: data });
3037 var id = self.id(choice.data("select2-data"));
3038 if (indexOf(id, val) >= 0) {
3137 if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
3163 // val is an id. !val is true for [undefined,null,'',0] - 0 is legal
3188 var ids=$.map(data, self.id);
3226 val.push(self.opts.id($(this).data("select2-data")));
3243 ids = $.map(values, function(e) { return self.opts.id(e); });
3345 id: function (e) { return e == undefined ? null : e.id; },