gogoWebsite

Event listening method in extjs

Updated to 2 days ago
Event listening method:
(1) This method mainly provides dom objects with events to listen to
(document).on('event',function(){processing method});
(2) Write it in the container like panel
listeners{'event',function(){processing method}};
(3) Perform event monitoring on the defined js class
       var eastpanel=new ({
            region:'east',
            collapsible: true,
            width: 275,
            items: [{....}]
            });
      ("collapse",function(e){
        alert("ssad");

        });

(4) Suppose there is a variable gridPanel of type GridPanel
      ('rowclick',function(){  
             alert(3)}  
      );  

 
For example:
How to add keyboard listening events to the textfield of a form:
var searchKey = new ({ //text     
                id: 'searchkey',   
                fieldLabel: 'text',   
                name: 'text',   
                defaultType: 'textfield',   
                grow: false,   
blankText: "It is best not to empty this field",
                enableKeyEvents: true 
            });   
            ('keypress', function(e){   
// Listen to the Enter button
                if (() == && ().length > 0) {   
                    alert("OK");}
            });