Lines Matching defs:results

412      * @param options.results a function(remoteData, pageNumber) that converts data returned form the remote request to the format expected by Select2.
414 * results array of objects that will be used as choices
415 * more (optional) boolean indicating whether there are more results available
416 * Example: {results:[{id:1, text:'Red'},{id:2, text:'Blue'}], more:true}
459 var results = options.results(data, query.page);
460 query.callback(results);
490 data = { results: tmp };
509 var t = query.term, filtered = { results: [] }, process;
535 $(data().results).each2(function(i, datum) { process(datum, filtered.results); });
544 var t = query.term, filtered = {results: []};
549 filtered.results.push(isObject ? this : {id: this, text: this});
579 function countResults(results) {
581 $.each(results, function(i, item) {
671 var results, search, resultsSelector = ".select2-results";
725 this.results = results = this.container.find(resultsSelector);
737 installFilteredMouseMove(this.results);
743 installDebouncedScroll(80, this.results);
750 // if jquery.mousewheel plugin is installed we can prevent out-of-bounds scrolling of results via mousewheel
752 results.mousewheel(function (e, delta, deltaX, deltaY) {
753 var top = results.scrollTop();
755 results.scrollTop(0);
757 } else if (deltaY < 0 && results.get(0).scrollHeight - results.scrollTop() + deltaY <= results.height()) {
758 results.scrollTop(results.get(0).scrollHeight - results.height());
882 populateResults: function(container, results, query) {
885 populate=function(results, container, depth) {
889 results = opts.sortResults(results, container, query);
891 for (i = 0, l = results.length; i < l; i = i + 1) {
893 result=results[i];
901 node.addClass("select2-results-dept-"+depth);
933 liveRegion.text(opts.formatMatches(results.length));
936 populate(results, container, 0);
954 var data = { results: [], more: false },
983 children.each2(function(i, elm) { process(elm, data.results); });
1227 resultsListNode = $('.select2-results', $dropdown)[0];
1402 this.results.empty();
1411 * Opens control, sets input value, and updates results.
1432 var results = this.results, children, index, child, hb, rb, y, more;
1444 results.scrollTop(0);
1454 // if this is the last child lets also make sure select2-more-results is visible
1456 more = results.find("li.select2-more-results");
1462 rb = results.offset().top + results.outerHeight(true);
1464 results.scrollTop(results.scrollTop() + (hb - rb));
1466 y = child.offset().top - results.offset().top;
1470 results.scrollTop(results.scrollTop() + y); // y is negative
1476 return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)");
1526 this.results.find(".select2-highlighted").removeClass("select2-highlighted");
1556 var results = this.results,
1557 more = results.find("li.select2-more-results"),
1565 below = more.offset().top - results.offset().top - results.height();
1581 self.opts.populateResults.call(this, results, data.results, {term: term, page: page, context:context});
1585 more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore, page+1));
1611 results = this.results,
1626 // if the search is currently hidden we do not alter the results
1634 if (results.find('.select2-no-results,.select2-selection-limit,.select2-searching').length) {
1635 self.liveRegion.text(results.text());
1638 self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable').length));
1643 results.html(html);
1660 render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooShort, search.val(), opts.minimumInputLength) + "</li>");
1670 render("<li class='select2-no-results'>" + evaluate(opts.formatInputTooLong, search.val(), opts.maximumInputLength) + "</li>");
1717 def = this.opts.createSearchChoice.call(self, search.val(), data.results);
1719 if ($(data.results).filter(
1723 this.opts.createSearchChoicePosition(data.results, def);
1728 if (data.results.length === 0 && checkFormatter(opts.formatNoMatches, "formatNoMatches")) {
1729 render("<li class='select2-no-results'>" + evaluate(opts.formatNoMatches, search.val()) + "</li>");
1733 results.empty();
1734 self.opts.populateResults.call(this, results, data.results, {term: search.val(), page: this.resultsPage, context:null});
1737 results.append("<li class='select2-more-results'>" + self.opts.escapeMarkup(evaluate(opts.formatLoadMore, this.resultsPage)) + "</li>");
1780 highlighted=this.results.find(".select2-highlighted"),
1889 " <ul class='select2-results' role='listbox'>",
2013 this.results.attr("id", "select2-results-"+idSuffix);
2014 this.search.attr("aria-owns", "select2-results-"+idSuffix);
2316 // hide the search box if this is the first we got the results and there are enough of them for search
2321 this.showSearch(countResults(data.results) >= min);
2487 " <ul class='select2-results'>",
2903 // if we reached max selection size repaint the results so choices
3032 choices = this.results.find(".select2-result"),
3033 compound = this.results.find(".select2-result-with-children"),
3057 //If all results are chosen render formatNoMatches
3059 if(!data || data && !data.more && this.results.find(".select2-no-results").length === 0) {
3061 this.results.append("<li class='select2-no-results'>" + evaluate(self.opts.formatNoMatches, self.search.val()) + "</li>");
3329 sortResults: function (results, container, query) {
3330 return results;
3334 formatMatches: function (matches) { return matches + " results are available, use up and down arrow keys to navigate."; },
3339 formatLoadMore: function (pageNumber) { return "Loading more results…"; },