title: knockoutjs: can we create a dependentObservable function with a parameter?
body: <p>I have multiple input boxes that I want to hide/unhide based on a selection from user. </p>
  
  <p>I can achieve this by having a separate dependentObservable for each input and in turn making the dependentObservable observe the parent selection.</p>
  
  <pre><code>viewModel.showField1= ko.dependentObservable(function () {
      return viewModel.selectedType() ? IsFeatureVisible(viewModel, "BusinessFieldName1") : false;
  }, viewModel
  );
  
  viewModel.showField1= ko.dependentObservable(function () {
      return viewModel.selectedType() ? IsFeatureVisible(viewModel, "BusinessFieldName2") : false;
  }, viewModel
  );
  </code></pre>
  
  <p>this is kind of tedious to do for each field. Can I bind the elements with a dependentObservable function that can take a parameter? Important thing is it should get triggered when the parent changes</p>
  
  <p>Other option is that when the parent changes, I loop through the elements and hide/unhide but that will require me to map the element id &lt;-> business name of the field.</p>
  
  <p><strong>Current</strong></p>
  
  <pre><code> &lt;tr data-bind="visible: showField1"&gt;
   &lt;tr data-bind="visible: showField2"&gt;
  </code></pre>
  
  <p><strong>Desired</strong> </p>
  
  <pre><code>&lt;tr data-bind="visible: showField('BusinessFieldName1')"&gt;
  &lt;tr data-bind="visible: showField('BusinessFieldName2')"&gt;
  </code></pre>