When selecting values on chosen lists on a page, then leaving the page, then coming back, the values are still set in the chosen selects. No matter what I do.
I've already searched a lot for this. I've tried the following:
$(".chzn-select").val('').trigger("liszt:updated");
$(".chzn-select").val('').trigger("chosen:updated");
I've tried to add optionsCaption in data-bind, like here.
I am desperately resetting my value observables to null, '', [], whatever, nothing works.
Any super trick here?
Thanks
Update: here's code, if that can help. Html:
<select class="chzn-select left" multiple id="selectsector" data-bind="optionsCaption: '', options: sectors(), selectedOptions: selectedSectors, optionsText: 'name'"></select>
And JS:
var sectors = ko.observableArray(),
selectedSectors = ko.observableArray();
I populate sectors with standard js objects, nothing fancy and it works well.
Nicolas