title: kendo.widgetInstance throws exception TypeError: t is undefined
body: <p>I'm trying to use kendo.widgetInstance() to get an instance of a kendo control:</p>
  
  <pre><code>$.each($('#AttributeForm').find(':input'), function(index, element) {
      if ($(element).closest('.k-widget').length &gt; 0) {
          var widgetObject = kendo.widgetInstance($(element), kendo.ui);
  
          if (typeof widgetObject != 'undefined') widgetObject.enable(false);
      }
  });
  </code></pre>
  
  <p>However, the kendo.widgetInstance() function is always throwing an error, TypeError: t is undefined.</p>
  
  <p>This code is adapted from the following page:</p>
  
  <p><a href="http://docs.kendoui.com/getting-started/widgets#getting-reference-to-an-unknown-kendo-ui-widget" rel="nofollow">http://docs.kendoui.com/getting-started/widgets#getting-reference-to-an-unknown-kendo-ui-widget</a></p>
  
  <p>Using the 2013.2.918 version.</p>
  
  <p>Is this the correct way to get an instance of a kendo widget?  All I want to do is disable all the kendo widgets inside the form and there are several different types but I don't know how many or what type they are.</p>
  
  <p>Updated to show the correct way to disable a kendo control and the final code that worked for me.</p>