Look at the code first
Ext.define ("PSI. Sale.wsmainform ", {extend:" Ext.panel.Panel ", border:0, Layout:" Border ", Initcomponent:function () { var me = this; The following code is slightly
1, the main meaning of the above code is to define a new Class:PSI.Sale.WSMainForm, the parent class is: Ext.panel.Panel
2, today's new knowledge point is: initcomponent
If you want to add new components to the UI, writing code in InitComponent is a must. So in many of the Psi JS code, there is a large section of code in the InitComponent, which is standard.
Ext.apply
This method is commonly used in initcomponent ext.apply, for example:
Ext.apply (me, { tbar: [{ text: "New Sales Return inbound order", iconCls: "Psi-button-add", scope: me, handler: me.onAddSRBill }, "-", { text: "Edit Sales return inbound order", iconCls: "Psi-button-edit", scope: me, handler: me.onEditSRBill } // the following code slightly
In layman's words, the Ext.apply method is to add attributes to an object, such as:
var a = {name: ' PSI ', age:30}; Ext.applay (A, {age:40, Region: ' Dalian '});//A + = {name: ' PSI ', age:40, Region: ' Dalian '}
The principle of merging is that existing properties are overwritten with new values, and new attributes are added.
Open source Invoicing Psi-extjs knowledge points (2)