Use of the pre-configuration class of ExtJS
<Script type = "text/javascript" src = "<% = basePath %>/ext-3.4/ext-all.js"> </script> <Script type = "text/javascript" src = "<% = basePath %>/jsp/js/HelloWindow. js "> </script> <script type =" text/javascript "> // commonly used components, such as view components, are often used in Extjs component design. If you want to set the size and title of a view component each time you use it, it will be very annoying. Pre-configuration // is to set the component attributes in advance so that specific attributes have specific default values first, to directly use Ext. onReady (function () {var helloWindow = new HelloWindow ({items: {html :'This is a window.
'}}); HelloWindow. show ('windowdiv') ;}); </script>
HelloWindow. js is as follows:
Var HelloWindow = Ext. extend (Ext. window, {title: 'hel', width: 500, height: 300, // rewrite the initComponent method initComponent: function () {lele.info ("start HelloWindow component. "); // equivalent to Ext. window. prototype. initComponent. apply (this, arguments) HelloWindow. superclass. initComponent. apply (this, arguments );}})