private void resultsReset(Event e) { OptionElement firstoption = selectElement.getOptions().getItem(0); if (firstoption != null) { firstoption.setSelected(true); } selectedItem.find("span").text(defaultText); if (!isMultiple) { selectedItem.addClass(css.chznDefault()); } showSearchFieldDefault(); resultsResetCleanup(); fireEvent(new ChosenChangeEvent(null, this)); if (activeField) { resultsHide(); } }
private void resultDeselect(int index) { OptionItem item = (OptionItem) selectItems.get(index); item.setSelected(false); // select option in original element OptionElement option = selectElement.getOptions().getItem(item.getOptionsIndex()); option.setSelected(false); $("#" + containerId + "_o_" + index) .removeClass(css.resultSelected()) .addClass(css.activeResult()) .show(); resultClearHighlight(); winnowResults(); fireEvent(new ChosenChangeEvent(option.getValue(), false, this)); searchFieldScale(); }