boszlo
boszlo

Reputation: 1286

Updating Chosen Dynamically

I'm using Chosen plugin and I got about 10 000 options in the dropdown. After user selects his option I want to reset chosen to it's default option. When liszt-update gets triggered it takes about 5 seconds for dropdown to render (as it contains so many options). Is there any way around it?

My code:

$('#chosen_orgs').val('0').trigger('liszt:updated');

Thanks.

Upvotes: 1

Views: 3730

Answers (1)

isherwood
isherwood

Reputation: 61063

You could manually update your original select instead.

$('#chosen_orgs, #original_select_id').val('0');

Also, just an FYI, Select2 is a much more well-developed fork of Chosen, and the syntax conversion is fairly simple.

Upvotes: 3

Related Questions