title: Knockout JS and Chosen multiselect not working
body: <p>I'm using knockout js and the chosen plugin (https://github.com/harvesthq/chosen) to try and make a good looking multi select.</p>
  
  <p>I've tried various ways but can't get the multiselect to work with the data I'm using.  When I click on the multiselect, no values are shown even though the options binding contains the correct data.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;select multiple="multiple" data-bind="options: allCustomers, 
  selectedOptions: event().customers, optionsText: 'name', 
  optionsValue: 'id', chosen: true " &gt;&lt;/select&gt;​
  </code></pre>
  
  <p>Simplified version of the view model:</p>
  
  <pre><code>    function Event()
      {
          this.customers = ko.observableArray();
      };                     
  
      //for chosen plugin
      ko.bindingHandlers.chosen = {
          update: function(element, valueAccessor, allBindingsAccessor, viewModel)  {
              $(element).chosen();
          }
      }
  
      function ViewModel()
      {   
          this.event = ko.observable(new Event());
          this.allCustomers = ko.observableArray();
      };
  
      var viewModel = new ViewModel();
  
      $.getJSON("/get_json", function(data) 
      {                                  
          for (var c = 0; c &lt; data.customers.length; c++)
          {
              viewModel.allCustomers.push(data.customers[c]);
          }   
      });
  
      ko.applyBindings(viewModel);   
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>function get_json()
  {
      $eventData = array(
          'customers' =&gt; array(array('name' =&gt; 'Bob', 'id' =&gt; 1), array('name' =&gt; 'John', 'id' =&gt; 2)),
          'moreData' =&gt; array(),
          'evenMoreData' =&gt; array()
          );
  
      echo json_encode($eventData);
  }
  </code></pre>
  
  <p>This shows the chosen styled select box but when I click in it, no options appear. </p>
  
  <p>When I create a local JS array in the view model for the customers and pass that into allCustomers, the multiselect works correctly (see my <a href="http://jsfiddle.net/Bcz4x/1/" rel="nofollow">jsfiddle</a>) so it's something to do with getting data from the server, but I've been staring at this a while and can't see the problem!</p>
  
  <p>Any help much appreciated</p>