protected void showSearchFieldDefault(String defaultText) { searchField.val(""); searchField.removeClass(css.defaultClass()); }
private void resultsResetCleanup() { currentValue = $selectElement.val(); selectedItem.find("abbr").remove(); }
@Override protected boolean keydownChecker(Event e) { if (e.getKeyCode() != BACKSPACE) { clearBackstroke(); } else { backstrokeLength = getSearchField().val().length(); } return super.keydownChecker(e); }
private boolean activateField(Event e) { if (!isMultiple && !activeField) { searchField.attr(TABINDEX_PROPERTY, selectedItem.attr(TABINDEX_PROPERTY)); selectedItem.attr(TABINDEX_PROPERTY, -1); } container.addClass(css.chznContainerActive()); activeField = true; searchField.val(searchField.val()); searchField.focus(); return false; }
@Override protected boolean keydownChecker(Event e) { if (e.getKeyCode() != BACKSPACE) { clearBackstroke(); } else { backstrokeLength = getSearchField().val().length(); } return super.keydownChecker(e); }
/** * Sets the value attribute of every matched element based in the return value of the function * evaluated for this element. * * NOTE: in jquery the function receives the arguments in different way, first index and them the * actual value, but we use the normal way in gquery Function, first the element and second the * index. */ public GQuery val(Function f) { for (int i = 0; i < size(); i++) { eq(i).val(f.f(get(i), i).toString()); } return this; }
protected void choiceDestroy(GQuery link) { choices--; showSearchFieldDefault(defaultText); if (isMultiple() && choices > 0 && searchField.val() != null && searchField.val().length() < 1) { resultsHide(); } resultDeselect(Integer.parseInt(link.attr("rel")), link.attr("data-chosen-value")); link.parents("li").first().remove(); }
protected void choiceDestroy(GQuery link) { choices--; showSearchFieldDefault(defaultText); if (isMultiple() && choices > 0 && searchField.val() != null && searchField.val().length() < 1) { resultsHide(); } resultDeselect(Integer.parseInt(link.attr("rel")), link.attr("data-chosen-value")); link.parents("li").first().remove(); }
@Override protected void containerMouseDownImpl(Event e, GQuery element) { if (pendingDestroyClick) { pendingDestroyClick = false; return; } if (!activeField) { getSearchField().val(""); $(document).click(clickTestAction); resultsShow(); } activateField(); }
@Override protected void showSearchFieldDefault(String defaultText) { if (choices < 1 && !activeField) { getSearchField().val(defaultText); getSearchField().addClass(getCss().defaultClass()); } else { super.showSearchFieldDefault(defaultText); } }
@Override protected void showSearchFieldDefault(String defaultText) { if (choices < 1 && !activeField) { getSearchField().val(defaultText); getSearchField().addClass(getCss().defaultClass()); } else { super.showSearchFieldDefault(defaultText); } }
private void winnowResultsClear() { searchField.val(""); GQuery lis = searchResults.find("li"); for (Element li : lis.elements()) { GQuery $li = $(li); if ($li.hasClass(css.groupResult())) { $li.css("display", ""); } else if (!isMultiple || !$li.hasClass(css.resultSelected())) { resultActivate($li); } } }