title: 'foreach' and 'with' binding not working together
body: <p>I am trying to bind a list using <code>foreach</code>, and also bind dropdown or select element in a table. When a user clicks on a select element associated tax value bind to the tax field. I bind this field using <code>with</code> binding context but it's not working, so what is the problem in my code?</p>
  
  <pre class="lang-js prettyprint-override"><code>function formatCurrency(value) {
      return "$" + value.toFixed(4);
  }
  
  function MEI(vm) {
      var self = this;
      self.Amount = ko.observable();
      self.RevenueDetails = ko.observableArray(vm.RevenueDetails());
      self.selectedItem = ko.observable();
      self.RepCode = ko.observable();
  }
  
  $(document).ready(function () {
      ko.applyBindings(new MEI(ko.mapping.fromJS(@Html.Raw(JsonConvert.SerializeObject(Model)))));
  });
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;table class="table table-striped table-bordered table-hover table-full-width" id="sample_2"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;Date&lt;/th&gt;
              &lt;th class="hidden-xs"&gt;TaxCode&lt;/th&gt;
              &lt;th class="hidden-xs"&gt;Tax&lt;/th&gt;
              &lt;th class="hidden-xs"&gt;Total&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody data-bind="foreach:RevenueDetails"&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input type="text" class="form-control form-control-inline input-medium date-picker"  data-date-format="mm-dd-yyyy" readonly&gt;
              &lt;/td&gt;   
              &lt;td&gt;
                  &lt;select class="form-control" data-bind='options:DefaultTaxCodes, optionsCaption: " -- ", optionsText: function (item) { return item.Tax }, optionsValue: function (item) { return item.TaxCodeId }, value:$parent.selectedItem'&gt;
                  &lt;/select&gt;
              &lt;/td&gt;                         
              &lt;td data-bind="with:$parent.selectedItem"&gt;  
                  &lt;span data-bind="text:TaxRate" /&gt;                              
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;input  class="form-control"  /&gt;                             
              &lt;/td&gt;   
            &lt;/tr&gt;
      &lt;/tbody&gt;         
  &lt;/table&gt;
  </code></pre>
  
  
  
  <p><a href="https://i.stack.imgur.com/8i0IP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8i0IP.png" alt="enter image description here"></a></p>