This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".chzn-select").html('<option></option>'); | |
$(".chzn-select").trigger("liszt:updated"); | |
$(".chzn-select").next('.chzn-container').find(".search-field > input, .chzn-search > input").unbind('keyup'); | |
// then reinit ajax-chosen as usual | |
$(".chzn-select").ajaxChosen({ ... }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def select_from_ajax_chosen(item_text, field_id) | |
within "##{field_id}_chzn" do | |
find('a.chzn-single').click | |
input = find("div.chzn-search input") | |
item_text.each_char do |char| | |
input.native.send_keys char | |
end | |
sleep 1 | |
input.native.send_keys :arrow_down | |
input.native.send_keys :return |