title: Kendo UI Grid popup editing with MVVM
body: <p>I am using Kendo UI Grid and I have configured it to use popup editing with custom template </p>
  
  <pre><code>    &lt;script id="popup_editor" type="text/x-kendo-template"&gt;
      &lt;div id="editor"&gt;
              &lt;div class="k-edit-label"&gt;
                  &lt;label for="Type"&gt;Type&lt;/label&gt;
              &lt;/div&gt;
  
      &lt;select data-role="dropdownlist" data-value-field="Type" data-text-field="Type"
                           data-bind="source: typeSource, value: selectedProduct"&gt;&lt;/select&gt;
  
  &lt;div class="k-edit-label"&gt;
                  &lt;label for="Type"&gt;Option&lt;/label&gt;
              &lt;/div&gt;
  
  &lt;select data-role="dropdownlist" data-value-field="Option" data-text-field="Option"
                           data-bind="source: productsSource.Options, value: selectedOption"&gt;&lt;/select&gt;
              &lt;/div&gt;
  
  &lt;/script&gt;
  </code></pre>
  
  <p>This is my ViewModel:</p>
  
  <pre><code>    function ViewModel() {
          var getTypesUrl = "/Controller/Action";
  
          var viewModel = kendo.observable({
              typeSource: new kendo.data.DataSource({
                  transport: {
                      read: {
                          url: getConditionTypesUrl,
                          dataType: "json"
                      },
                  },
                  batch: true,
                  schema: {
                      model: {
                          id: "Type"
                      }
                  }
              }),
              selectedType: null,
              selectedOption: null
          });
  
          kendo.bind($("#editor"), viewModel);
      }
  
  ViewModel();
  </code></pre>
  
  <p>My action returns JSON.</p>
  
  <p>The problem is that when I click on the "<strong>Add new record</strong>" button, there is no call to the <code>getTypesUrl</code> and the dropdownlist is not populated. The general idea is to have different options for different types and to populate the Option dropdownlist depending on the selected type. I believe, that the problem occurs because the editor is showed only when the button is clicked and the kendo can not create the bindings.</p>