Ext.NET MVC – TextBox FocusLeave Event

Ext.NET MVC – TextBox FocusLeave Event

 
   Define TextBox from View
 
   @(Html.X().TextField()
     .ID("SearchBtn").EnableKeyEvents(true).Listeners(x => x.FocusLeave.Handler = "getvalue('SearchBtn')"))
 
   JavaScript to Show the TextBox Value
 
   function getvalue(id)
   {
     var t = Ext.getCmp(id);
 
     if (t instanceof Ext.form.TextField)
     {
       if (!t.readOnly)
         alert(t.getValue());
     }
   }